diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp index fd5f372a..f8669591 100644 --- a/Code/Game/GameLogic/CollisionManager.cpp +++ b/Code/Game/GameLogic/CollisionManager.cpp @@ -242,6 +242,18 @@ using namespace GameLogic; return; } + Player *player = realObjA->getManipulatingPlayer(); + if( player != nullptr ) + { + player->UseWeapon( WEAPON_INTERRUPT ); + } + + player = realObjB->getManipulatingPlayer(); + if( player != nullptr ) + { + player->UseWeapon( WEAPON_INTERRUPT ); + } + //check which obj is the one that is already affected, if both are then use the special case of changing ownership. if(realObjA->getAffectingPlayer() == NULL && realObjB->getAffectingPlayer() == NULL) //None of the objects have a player affecting them { @@ -350,7 +362,6 @@ using namespace GameLogic; weapon->heldObject = obj; //weapon now holds the object weapon->hasObject = true; dynamicObj->SetManipulatingPlayer(*weapon->owner); //TODO: add if this is to be a struggle of who has the most power in its weapon, the player that is already manipulating the object or you. if you then you take the object from the other player, if not then you do not take the object - break; } diff --git a/Code/Game/GameLogic/GameLogicStates.h b/Code/Game/GameLogic/GameLogicStates.h index f006ad27..5f3952fd 100644 --- a/Code/Game/GameLogic/GameLogicStates.h +++ b/Code/Game/GameLogic/GameLogicStates.h @@ -32,6 +32,7 @@ namespace GameLogic WEAPON_USE_SECONDARY_RELEASE = 4, WEAPON_USE_UTILLITY_PRESS = 8, WEAPON_USE_UTILLITY_RELEASE = 16, + WEAPON_INTERRUPT = 32 }; enum WEAPON_STATE