------------------------------------------------------------------------
| 887 | |
| 888 | //------------------------------------------------------------------------ |
| 889 | void CWeaponSystem::DebugGun(IConsoleCmdArgs *args) |
| 890 | { |
| 891 | IGameFramework* pGF = gEnv->pGame->GetIGameFramework(); |
| 892 | IItemSystem* pItemSystem = pGF->GetIItemSystem(); |
| 893 | |
| 894 | IActor* pActor = pGF->GetClientActor(); |
| 895 | if (!pActor || !pActor->IsPlayer()) |
| 896 | return; |
| 897 | |
| 898 | IInventory *pInventory = pActor->GetInventory(); |
| 899 | if (!pInventory) |
| 900 | return; |
| 901 | |
| 902 | // give & select the debuggun |
| 903 | EntityId itemId = pInventory->GetItemByClass(CItem::sDebugGunClass); |
| 904 | if (0 == itemId) |
| 905 | { |
| 906 | // if actor doesn't have it, only give it in editor |
| 907 | if (!gEnv->IsEditor()) |
| 908 | return; |
| 909 | |
| 910 | if(!CItem::sDebugGunClass) |
| 911 | { |
| 912 | CRY_ASSERT_MESSAGE(0, "DebugGun is not defined."); |
| 913 | return; |
| 914 | } |
| 915 | |
| 916 | itemId = pItemSystem->GiveItem(pActor, CItem::sDebugGunClass->GetName(), false, true, true); |
| 917 | } |
| 918 | pItemSystem->SetActorItem(pActor, itemId, true); |
| 919 | } |
| 920 | |
| 921 | //------------------------------------------------------------------------ |
| 922 | void CWeaponSystem::RefGun(IConsoleCmdArgs *args) |
no test coverage detected