Workaround for issue #146
This commit is contained in:
parent
f5b3bfda11
commit
5de031fb8b
|
@ -338,7 +338,7 @@ void Creature::onAppear()
|
|||
m_removed = false;
|
||||
callLuaField("onAppear");
|
||||
// walk
|
||||
} else if(m_oldPosition != m_position && m_oldPosition.isInRange(m_position,1,1)) {
|
||||
} else if(m_oldPosition != m_position && m_oldPosition.isInRange(m_position,1,1) && m_allowAppearWalk) {
|
||||
walk(m_oldPosition, m_position);
|
||||
callLuaField("onWalk", m_oldPosition, m_position);
|
||||
// teleport
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
void turn(Otc::Direction direction);
|
||||
virtual void walk(const Position& oldPos, const Position& newPos);
|
||||
virtual void stopWalk();
|
||||
void allowAppearWalk() { m_allowAppearWalk = true; }
|
||||
|
||||
bool isWalking() { return m_walking; }
|
||||
bool isRemoved() { return m_removed; }
|
||||
|
@ -155,6 +156,7 @@ protected:
|
|||
Timer m_footTimer;
|
||||
TilePtr m_walkingTile;
|
||||
stdext::boolean<false> m_walking;
|
||||
stdext::boolean<false> m_allowAppearWalk;
|
||||
stdext::boolean<false> m_footStepDrawn;
|
||||
ScheduledEventPtr m_walkUpdateEvent;
|
||||
EventPtr m_disappearEvent;
|
||||
|
|
|
@ -519,6 +519,9 @@ void ProtocolGame::parseCreatureMove(const InputMessagePtr& msg)
|
|||
return;
|
||||
}
|
||||
|
||||
CreaturePtr creature = thing->static_self_cast<Creature>();
|
||||
creature->allowAppearWalk();
|
||||
|
||||
g_map.addThing(thing, newPos, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue