diff options
author | Paweł Redman <trem.redman@gmail.com> | 2013-09-09 23:24:54 +0200 |
---|---|---|
committer | Paweł Redman <trem.redman@gmail.com> | 2013-09-09 23:24:54 +0200 |
commit | 37b8af1e6eb90378f1290b5130c8b6882b06a219 (patch) | |
tree | 1f8c00819cf59b7147e657dcb90d9ccc2e0d7989 /src/game/g_buildable.c | |
parent | 27a16fb1fa69d458fb10e6437eb07b85496b46b8 (diff) |
0.1.3
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r-- | src/game/g_buildable.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index beb7e37..b13c54a 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -4548,3 +4548,36 @@ void G_BuildLogRevert( int id ) } } +/* +============ +G_RemoveUnbuiltBuildables + +Kill all player's buildables if they havent spawned yet +============ +*/ +void G_RemoveUnbuiltBuildables( gentity_t *self ) +{ + int i; + vec3_t dir; + gentity_t *ent; + + dir[0] = dir[1] = 0.0f; + dir[2] = 1.0f; + + for( i = MAX_CLIENTS, ent = g_entities + i; i < level.num_entities; i++, ent++ ) + { + if( ent->s.eType != ET_BUILDABLE ) + continue; + + if( ent == self ) + continue; + + if( ent->spawned ) + continue; + + if( ent->builtBy != self->client->ps.clientNum ) + continue; + + G_Damage( ent, self, NULL, dir, dir, ent->health, 0, MOD_DECONSTRUCT ); + } +} |