Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10927] Prevent null-pointer dereference in AI calls
- Loading branch information
zergtmn
committed
Dec 28, 2010
1 parent
61d8898
commit b1f3d8e
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#ifndef __REVISION_NR_H__ | ||
#define __REVISION_NR_H__ | ||
#define REVISION_NR "10926" | ||
#define REVISION_NR "10927" | ||
#endif // __REVISION_NR_H__ |
b1f3d8e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be preferable to do:
if(!IsInEvadeMode() && AI()) or if(AI() && !IsInEvadeMode())
Instead of two Ifs? Just a thought.
b1f3d8e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe or maybe not. This is checks for different states. I meaning: selected by its cases can be for diff purpose.
For example if we in future get some else case for IsInEvadeMode() then AI() check will be not good placed.
In current state impossible say how better :) Maybe for more clear code better all internal if move to Creature::UpdateAI helper function.