diff --git a/src/cs2_sdk/entity/cbaseplayerpawn.h b/src/cs2_sdk/entity/cbaseplayerpawn.h index 662af781..5341beed 100644 --- a/src/cs2_sdk/entity/cbaseplayerpawn.h +++ b/src/cs2_sdk/entity/cbaseplayerpawn.h @@ -39,7 +39,7 @@ class CBasePlayerPawn : public CBaseModelEntity SCHEMA_FIELD(QAngle, v_angle) // Drops any map-spawned weapons the pawn is holding - // NOTE: Currently very broken with map items (entities parented to weapons?) due to a game bug..? Needs further investigation/work + // NOTE: This doesn't predict correctly to the weapon holder! Looks very funky when testing, but not really an issue on live servers void DropMapWeapons() { if (!m_pWeaponServices()) diff --git a/src/zombiereborn.cpp b/src/zombiereborn.cpp index 4ee3f4a2..db1f3cf9 100644 --- a/src/zombiereborn.cpp +++ b/src/zombiereborn.cpp @@ -1147,7 +1147,21 @@ void ZR_StripAndGiveKnife(CCSPlayerPawn *pPawn) pPawn->DropMapWeapons(); pItemServices->StripPlayerWeapons(true); - pItemServices->GiveNamedItem("weapon_knife"); + + if (pPawn->m_iTeamNum == CS_TEAM_T) + { + pItemServices->GiveNamedItem("weapon_knife_t"); + } + else if (pPawn->m_iTeamNum == CS_TEAM_CT) + { + pItemServices->GiveNamedItem("weapon_knife"); + + // CONVAR_TODO + ConVar* cvar = g_pCVar->GetConVar(g_pCVar->FindConVar("mp_free_armor")); + // HACK: values is actually the cvar value itself, hence this ugly cast. + if (*(int*)&cvar->values > 0) + pItemServices->GiveNamedItem("item_kevlar"); + } CUtlVector>* weapons = pWeaponServices->m_hMyWeapons(); @@ -1287,6 +1301,7 @@ void ZR_InfectMotherZombie(CCSPlayerController *pVictimController, std::vectorSwitchTeam(CS_TEAM_T); ZR_StripAndGiveKnife(pVictimPawn); // pick random spawn point @@ -1299,7 +1314,6 @@ void ZR_InfectMotherZombie(CCSPlayerController *pVictimController, std::vectorTeleport(&origin, &rotation, &vec3_origin); } - pVictimController->SwitchTeam(CS_TEAM_T); pVictimPawn->EmitSound("zr.amb.scream"); std::shared_ptr pClass = g_pZRPlayerClassManager->GetZombieClass("MotherZombie"); @@ -2006,7 +2020,11 @@ CON_COMMAND_CHAT_FLAGS(revive, "- Revive a player", ADMFLAG_GENERIC) CCSPlayerController* pTarget = CCSPlayerController::FromSlot(pSlots[i]); CCSPlayerPawn* pPawn = (CCSPlayerPawn*)pTarget->GetPawn(); + if (!pPawn) + continue; + ZR_Cure(pTarget); + ZR_StripAndGiveKnife(pPawn); if (iNumClients == 1) PrintSingleAdminAction(pszCommandPlayerName, pTarget->GetPlayerName(), "revived", "", ZR_PREFIX);