diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 13d0596f7..aa4657f68 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -1314,35 +1314,6 @@ void CNpcEnemy::processEvent( GAME_EVENT evt, CThing *sourceThing ) { switch( evt ) { - case USER_REQUEST_TALK_EVENT: - { - if ( m_data[this->m_type].canTalk ) - { - DVECTOR sourcePos; - s32 xDiffSqr, yDiffSqr; - - // check talk distance - - sourcePos = sourceThing->getPos(); - - xDiffSqr = this->Pos.vx - sourcePos.vx; - xDiffSqr *= xDiffSqr; - - yDiffSqr = this->Pos.vy - sourcePos.vy; - yDiffSqr *= yDiffSqr; - - if ( xDiffSqr + yDiffSqr < 10000 ) - { - if( !CConversation::isActive() ) - { - CConversation::trigger( SCRIPTS_SPEECHTEST_DAT ); - } - } - } - - break; - } - case PROJECTILE_RETURNED_TO_SOURCE_EVENT: { m_controlFunc = NPC_CONTROL_MOVEMENT; diff --git a/source/friend/friend.cpp b/source/friend/friend.cpp index ad92b3573..fe96b64b2 100644 --- a/source/friend/friend.cpp +++ b/source/friend/friend.cpp @@ -250,42 +250,15 @@ void CNpcFriend::render() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing ) +void CNpcFriend::startConderversation() { - switch( evt ) + // I am 'avin a fayg + + if ( m_data[this->m_type].canTalk ) { - case USER_REQUEST_TALK_EVENT: + if( !CConversation::isActive() ) { - if ( m_data[this->m_type].canTalk ) - { - DVECTOR sourcePos; - s32 xDiffSqr, yDiffSqr; - - // check talk distance - - sourcePos = sourceThing->getPos(); - - xDiffSqr = this->Pos.vx - sourcePos.vx; - xDiffSqr *= xDiffSqr; - - yDiffSqr = this->Pos.vy - sourcePos.vy; - yDiffSqr *= yDiffSqr; - - if ( xDiffSqr + yDiffSqr < 10000 ) - { - if( !CConversation::isActive() ) - { - CConversation::trigger( SCRIPTS_SPEECHTEST_DAT ); - } - } - } - - break; + CConversation::trigger( SCRIPTS_SPEECHTEST_DAT ); } - - default: - // ignore - - break; } -} +} \ No newline at end of file diff --git a/source/friend/friend.h b/source/friend/friend.h index a91dbe837..008a0604b 100644 --- a/source/friend/friend.h +++ b/source/friend/friend.h @@ -42,7 +42,6 @@ public: void shutdown(); virtual void think(int _frames); void render(); - void processEvent( GAME_EVENT evt, CThing *sourceThing ); void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;} void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;} @@ -75,6 +74,8 @@ protected: static NPC_FRIEND_UNIT_TYPE mapEditConvertTable[NPC_FRIEND_UNIT_TYPE_MAX]; + void startConderversation(); + enum { EXTEND_RIGHT = true, diff --git a/source/game/event.h b/source/game/event.h index 94f4740eb..f357a9103 100644 --- a/source/game/event.h +++ b/source/game/event.h @@ -7,7 +7,6 @@ enum GAME_EVENT { - USER_REQUEST_TALK_EVENT, PROJECTILE_RETURNED_TO_SOURCE_EVENT, };