Picked box should be dropped when impacted by any dynamic object

This commit is contained in:
Dander7BD 2014-02-27 14:36:15 +01:00
parent 8111e9f51e
commit 2592e4d3e3
2 changed files with 13 additions and 1 deletions

View File

@ -242,6 +242,18 @@ using namespace GameLogic;
return; 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. //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 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->heldObject = obj; //weapon now holds the object
weapon->hasObject = true; 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 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; break;
} }

View File

@ -32,6 +32,7 @@ namespace GameLogic
WEAPON_USE_SECONDARY_RELEASE = 4, WEAPON_USE_SECONDARY_RELEASE = 4,
WEAPON_USE_UTILLITY_PRESS = 8, WEAPON_USE_UTILLITY_PRESS = 8,
WEAPON_USE_UTILLITY_RELEASE = 16, WEAPON_USE_UTILLITY_RELEASE = 16,
WEAPON_INTERRUPT = 32
}; };
enum WEAPON_STATE enum WEAPON_STATE