Skip to content

Conversation

@crkellen
Copy link
Contributor

This is a fix for #43.
The issue was twofold:

  • There was no check if the Caster was swimming in 'castSpellInit()', which meant the spell was always being processed. A check for swimming was added to 'castSpellInit()' to solve this issue.
  • The check inside of 'castSpell()' was after MP had already been drained. Moving it before this point solves the issue.

Copy link
Contributor

@lheckemann lheckemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good in principle, but increases duplication even further than it's already gone. I'm not in favour of merging this as is.

Also the ever-present indentation issues — I'm going to stop mentioning those in the rest of my reviews, I'm sure you've got the idea now ;)

}

// If both cases are false, the Caster could potentially be swimming
if ( bIsCasterLevitating != true && bIsCasterWaterWalking != true )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!= true is redundant on bools :)

return;
}

// Check to make sure the Caster is not swimming
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of conditions here which are duplicated (not only in here but in actplayer.cpp, acthudweapon.cpp, which should probably be factored out to reduce the duplication and the amount of code that needs to be changed should additional conditions for swimming be added.

@crkellen
Copy link
Contributor Author

crkellen commented Sep 24, 2017 via email

@crkellen
Copy link
Contributor Author

Please see pull request #171. It is a replacement for this one, and also a fix for #143.
This pull request should not be valued over the other one.

@crkellen crkellen closed this Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants