mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
Fixed weapon cleanup when dropped by disconnected players.
This commit is contained in:
parent
799d6ba65b
commit
a82a983b52
@ -1061,9 +1061,30 @@ public void OnClientPutInServer(int client)
|
|||||||
|
|
||||||
public void OnClientDisconnect(int client)
|
public void OnClientDisconnect(int client)
|
||||||
{
|
{
|
||||||
|
if(gB_NoWeaponDrops)
|
||||||
|
{
|
||||||
|
int entity = -1;
|
||||||
|
|
||||||
|
while((entity = FindEntityByClassname(entity, "weapon_*")) != -1)
|
||||||
|
{
|
||||||
|
if(GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity") == client)
|
||||||
|
{
|
||||||
|
RequestFrame(RemoveWeapon, EntIndexToEntRef(entity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ResetCheckpoints(client);
|
ResetCheckpoints(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemoveWeapon(any data)
|
||||||
|
{
|
||||||
|
if(IsValidEntity(data))
|
||||||
|
{
|
||||||
|
RemoveEntity(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ResetCheckpoints(int client)
|
void ResetCheckpoints(int client)
|
||||||
{
|
{
|
||||||
int serial = GetClientSerial(client);
|
int serial = GetClientSerial(client);
|
||||||
@ -1143,7 +1164,7 @@ public void OnWeaponDrop(int client, int entity)
|
|||||||
{
|
{
|
||||||
if(gB_NoWeaponDrops && IsValidEntity(entity))
|
if(gB_NoWeaponDrops && IsValidEntity(entity))
|
||||||
{
|
{
|
||||||
AcceptEntityInput(entity, "Kill");
|
RemoveEntity(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user