Server: Add support for game_playerspawn triggers. Basically upon any player spawning into the world, all entities named 'game_playerspawn' will be triggered with the player being set as the activator. Nifty

This commit is contained in:
Marco Cawthorne 2020-09-08 03:29:10 +02:00
parent cdad44a79d
commit 7680521379

View file

@ -70,6 +70,16 @@ void PutClientInServer(void)
pl = (player)self;
g_grMode.PlayerSpawn(pl);
/* activate all game_playerspawn entities */
for (entity a = world; (a = findfloat(a, ::gflags, GF_CANRESPAWN));) {
CBaseEntity ent = (CBaseEntity)a;
if (ent.m_strTargetName == "game_playerspawn") {
CBaseTrigger t = (CBaseTrigger)a;
t.Trigger(self, TRIG_TOGGLE);
}
}
}
void PlayerPreThink(void)