diff options
author | Mikko Tiusanen <ams@daug.net> | 2014-10-09 17:49:05 +0300 |
---|---|---|
committer | Mikko Tiusanen <ams@daug.net> | 2014-10-09 17:49:05 +0300 |
commit | cb6e022bb7aadf56d4f7ebc136f652fc18fbc44e (patch) | |
tree | 93a5863a85200ee42afa73954144156f02c2b922 /src/game/g_buildable.c | |
parent | fab71cd44004636f3298ef9cef363cf82d85c152 (diff) |
Added spawn [buildingname] admin command.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r-- | src/game/g_buildable.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 37e3e66..65e7077 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -4855,6 +4855,12 @@ static void G_SpawnBuildableThink( gentity_t *ent ) G_FreeEntity( ent ); } +static void G_ForceSpawnBuildableThink( gentity_t *ent ) +{ + G_FinishSpawningBuildable( ent, qtrue ); + G_FreeEntity( ent ); +} + /* ============ G_SpawnBuildable @@ -4875,6 +4881,16 @@ void G_SpawnBuildable( gentity_t *ent, buildable_t buildable ) ent->think = G_SpawnBuildableThink; } +void G_ForceSpawnBuildable( gentity_t *ent, buildable_t buildable ) +{ + ent->s.modelindex = buildable; + + // some movers spawn on the second frame, so delay item + // spawns until the third frame so they can ride trains + ent->nextthink = level.time + FRAMETIME * 2; + ent->think = G_ForceSpawnBuildableThink; +} + /* ============ G_LayoutSave @@ -5083,6 +5099,20 @@ static void G_LayoutBuildItem( buildable_t buildable, vec3_t origin, G_SpawnBuildable( builder, buildable ); } +static void G_LayoutForceBuildItem( buildable_t buildable, vec3_t origin, + vec3_t angles, vec3_t origin2, vec3_t angles2 ) +{ + gentity_t *builder; + + builder = G_Spawn( ); + builder->client = 0; + VectorCopy( origin, builder->s.pos.trBase ); + VectorCopy( angles, builder->s.angles ); + VectorCopy( origin2, builder->s.origin2 ); + VectorCopy( angles2, builder->s.angles2 ); + G_ForceSpawnBuildable( builder, buildable ); +} + /* ============== G_LayoutExists |