summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-10-09 17:49:05 +0300
committerMikko Tiusanen <ams@daug.net>2014-10-09 17:49:05 +0300
commitcb6e022bb7aadf56d4f7ebc136f652fc18fbc44e (patch)
tree93a5863a85200ee42afa73954144156f02c2b922 /src/game/g_buildable.c
parentfab71cd44004636f3298ef9cef363cf82d85c152 (diff)
Added spawn [buildingname] admin command.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c30
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