Add logs for failed stashes
This commit is contained in:
parent
c321f88d96
commit
be36f0631b
1 changed files with 2 additions and 0 deletions
|
@ -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--
|
||||||
|
|
Loading…
Add table
Reference in a new issue