Add logs for failed stashes

This commit is contained in:
Marc Di Luzio 2020-07-24 19:39:25 +01:00
parent c321f88d96
commit be36f0631b

View file

@ -280,11 +280,13 @@ func (w *World) RoverStash(rover string) (roveapi.Object, error) {
// Can't pick up when full // Can't pick up when full
if len(r.Inventory) >= r.Capacity { if len(r.Inventory) >= r.Capacity {
r.AddLogEntryf("tried to stash object but inventory was full")
return roveapi.Object_ObjectUnknown, nil return roveapi.Object_ObjectUnknown, nil
} }
// Ensure the rover has energy // Ensure the rover has energy
if r.Charge <= 0 { if r.Charge <= 0 {
r.AddLogEntryf("tried to stash object but had no charge")
return roveapi.Object_ObjectUnknown, nil return roveapi.Object_ObjectUnknown, nil
} }
r.Charge-- r.Charge--