diff --git a/Code/Game/GameLogic/Game.cpp b/Code/Game/GameLogic/Game.cpp index e4782582..5879bd86 100644 --- a/Code/Game/GameLogic/Game.cpp +++ b/Code/Game/GameLogic/Game.cpp @@ -182,7 +182,7 @@ void Game::SetDeadSubscription(GameEvent::ObjectDeadFunction functionPointer) } void Game::SetActionSubscription(GameEvent::AnimationEventFunction functionPointer) { - this->onPlayerActionEventFnc = functionPointer; + this->onActionEventFnc = functionPointer; } void Game::SetPickupSubscription(GameEvent::PickupEventFunction functionPointer) { diff --git a/Code/Game/GameLogic/Game.h b/Code/Game/GameLogic/Game.h index 22b9fbda..abef28f4 100644 --- a/Code/Game/GameLogic/Game.h +++ b/Code/Game/GameLogic/Game.h @@ -106,7 +106,7 @@ namespace GameLogic GameEvent::ObjectHpFunction onDamageTakenFnc; GameEvent::ObjectRespawnedFunction onRespawnFnc; GameEvent::ObjectDeadFunction onDeadFnc; - GameEvent::AnimationEventFunction onPlayerActionEventFnc; + GameEvent::AnimationEventFunction onActionEventFnc; GameEvent::PickupEventFunction onPickupEventFnc; }; } diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index ddacf25b..b2a448df 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -142,7 +142,7 @@ void Player::BeginFrame() if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING) { if(this->playerState != PLAYER_STATE::PLAYER_STATE_IDLE) - this->gameInstance->onPlayerActionEventFnc( this, PlayerAction::PlayerAction_Idle); + this->gameInstance->onActionEventFnc( this, PlayerAction::PlayerAction_Idle); this->playerState = PLAYER_STATE::PLAYER_STATE_IDLE; } } @@ -178,7 +178,7 @@ void Player::BeginFrame() if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING) { if(this->playerState != PLAYER_STATE::PLAYER_STATE_WALKING) - this->gameInstance->onPlayerActionEventFnc( this, PlayerAction::PlayerAction_Walk); + this->gameInstance->onActionEventFnc( this, PlayerAction::PlayerAction_Walk); this->playerState = PLAYER_STATE::PLAYER_STATE_WALKING; } } @@ -200,7 +200,7 @@ void Player::BeginFrame() this->rigidBody->ApplyImpulse(up*this->rigidBody->GetState().mass * 20); if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING) - this->gameInstance->onPlayerActionEventFnc( this, PlayerAction::PlayerAction_Jump); + this->gameInstance->onActionEventFnc( this, PlayerAction::PlayerAction_Jump); this->playerState = PLAYER_STATE::PLAYER_STATE_JUMPING; } } @@ -208,7 +208,7 @@ void Player::BeginFrame() { if(this->playerState == PLAYER_STATE::PLAYER_STATE_JUMPING) { - this->gameInstance->onPlayerActionEventFnc( this, PlayerAction::PlayerAction_Idle); + this->gameInstance->onActionEventFnc( this, PlayerAction::PlayerAction_Idle); this->playerState = PLAYER_STATE::PLAYER_STATE_IDLE; } }