RAWIG icon indicating copy to clipboard operation
RAWIG copied to clipboard

Clarify some concerns about returning some turnSpent values

Open VedVid opened this issue 5 years ago • 0 comments

"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

VedVid avatar Jan 20 '19 23:01 VedVid