VedVid / RAWIG

RAWIG (Roguelike Architecture, Written In Go) is ready to modify and expand roguelike architecture.
BSD 2-Clause "Simplified" License
16 stars 3 forks source link

Clarify some concerns about returning some turnSpent values #78

Open VedVid opened 5 years ago

VedVid commented 5 years ago

"Leftovers" of #70

To investigate further:
=====
In MoveOrAttack in monsters.go is

    if target != nil {
        c.AttackTarget(target)
        turnSpent = true

consider changing it to (need to change AttackTarget a bit) (need to check if it makes a sense - if execution of attack can't fail, it may remain as is)

    if target != nil {
        turnSpent = c.AttackTarget(target)
        turnSpent = true

=====
In DropFromInventory, add proper error handling, or return always true - because now setting turnSpent := false at start and adding turnSpent = true doesn't make much sense (except explicitness)
=====
Similarly in EquipItem in monsters.go - it has error handling, but will always return true anyway.
=====
Same for DequipItem in monsters.go