Skip to content

Commit

Permalink
[8880] Some adjustments/additions for updateflag_living and flying cr…
Browse files Browse the repository at this point in the history
…eatures

Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Nov 27, 2009
1 parent f65cd42 commit 5eec80f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion src/game/Object.cpp
Expand Up @@ -261,7 +261,27 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2)
{
case TYPEID_UNIT:
{
flags2 = ((Creature*)this)->canFly() ? (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING) : MOVEMENTFLAG_NONE;
flags2 = MOVEMENTFLAG_NONE;

if (!((Creature*)this)->IsStopped())
flags2 |= MOVEMENTFLAG_FORWARD; // not set if not really moving

if (((Creature*)this)->canFly())
{
flags2 |= MOVEMENTFLAG_LEVITATING; // (ok) most seem to have this

if (((Creature*)this)->IsStopped())
flags2 |= MOVEMENTFLAG_FLY_UNK1; // (ok) possibly some "hover" mode
else
{
if (((Creature*)this)->IsMounted())
flags2 |= MOVEMENTFLAG_FLYING; // seems to be often when mounted
/* for further research
else
flags2 |= MOVEMENTFLAG_FLYING2; // not seen, but work on some, even if not "correct"
*/
}
}
}
break;
case TYPEID_PLAYER:
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8879"
#define REVISION_NR "8880"
#endif // __REVISION_NR_H__

2 comments on commit 5eec80f

@SilverIce
Copy link

Choose a reason for hiding this comment

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

are you tested this? ((Creature*)this)->IsStopped() - its motion master state only, thats not mean that creature really stopped
it will improve visual bugs

  •            if (!((Creature*)this)->IsStopped())  
    
  •                flags2 |= MOVEMENTFLAG_FORWARD;         // not set if not really moving
    

http://getmangos.com/community/showthread.php?t=10636

@NoFantasy
Copy link

Choose a reason for hiding this comment

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

Strange question. If i tested it? Yes, of course. And yes, that was the point, as you can see from the code. If the current movement of the creature is not moving (is standing still, for any reason) then not apply the flag either. If the creature moves after this point, then the proper monsterMove flags are sent in a different packet.

Still, feel free to share your research on the forum to extend and improve it even further and also post reports about any negative effects after this patch :)

Please sign in to comment.