-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[11320] Check if Creature::GetRespawnCoord() function returns valid m…
…ap coordinates. Invalid data might cause crashes with movement generators. Signed-off-by: Ambal <pogrebniak@gala.net>
- Loading branch information
Ambal
committed
Apr 6, 2011
1 parent
09aa268
commit 52eb0dd
Showing
2 changed files
with
16 additions
and
9 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 "11319" | ||
#define REVISION_NR "11320" | ||
#endif // __REVISION_NR_H__ |
52eb0dd
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.
what reason check this? summon point is real point already added creature that already checked at adding. DB data checked at loading.
52eb0dd
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.
reason is: https://gist.github.com/904015 . More details in comments for [11306]
52eb0dd
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.
cheating, stupid GM's... additional checks - not bad.
52eb0dd
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.
checks in random place useless. If we say about coordinates check then it must checked in sources where wrong value can be added.
NOT in place where it get. Specially unconditionaly not under MANGOS_ASSERT
52eb0dd
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.
Vlad, if you have thoughts where we can improve such checks to prevent wrong data assignment - you are welcome. Problem is that placing checks in getters() will definitely yield results while you can chase setters() forever since incorrect(!) setter() usage will produce bugs even if all checks will be successful. As an example, checks in WorldObject::GetMap() function allowed us to get rid of all the nasty code in core related to Map data queries.
52eb0dd
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.
Why not make it in normal way for debug checks: guard by MANGOS_DEBUG #ifdef at least. You add check affect all players because rsa at havy modified sources get crash by assign wrong values in some unknown place. It's maybe assigned long before crash, maybe in prev tick and etc. Maybe rsa just not have set summon pos in one from summon calls and have garbage in related fields...
52eb0dd
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.
Vlad, we should protect mangos core from bad patches - if clean core will not crash with these checks, then this is not out problem that someone screwed main logic. We shouldn't care about patches which work as they want and not as they should. If you want, you are free to replace MANGOS_ASSERT() by less strict check but keep in mind: crappy code will crash in any way.