summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/bg_misc.c294
-rw-r--r--src/game/bg_public.h1
-rw-r--r--src/game/g_buildable.c1
-rw-r--r--src/game/g_cmds.c4
-rw-r--r--src/game/g_local.h4
-rw-r--r--src/game/g_spawn.c35
6 files changed, 23 insertions, 316 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index f497ef82..1e876b3c 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -820,279 +820,6 @@ gitem_t bg_itemlist[] =
"sound/items/flight.wav"
},*/
-/*QUAKED team_droid_spawn (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid spawn item
-*/
- {
- "team_droid_spawn",
- "sound/items/holdable.wav",
- { "models/buildables/bioegg/bioegg.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Droid Spawn", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_SPAWN,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_droid_barricade (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid defense item
-*/
- {
- "team_droid_def1",
- "sound/items/holdable.wav",
- { "models/buildables/barricade/barricade.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Barricade", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_BARRICADE,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_droid_acid_tube (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid defense item
-*/
- {
- "team_droid_acid_tube",
- "sound/items/holdable.wav",
- { "models/buildables/acid_tube/acid_tube.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Acid Tube", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_ACIDTUBE,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_droid_trapper (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid defense item
-*/
- {
- "team_droid_trapper",
- "sound/items/holdable.wav",
- { "models/buildables/trapper/trapper.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Trapper", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_TRAPPER,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_droid_trapper (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid defense item
-*/
- {
- "team_droid_booster",
- "sound/items/holdable.wav",
- { "models/buildables/booster/booster.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Booster", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_BOOSTER,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_droid_hivemind (0 0 1) (-16 -16 -16) (16 16 16)
-TA: droid build limitation item
-*/
- {
- "team_droid_hivemind",
- "sound/items/holdable.wav",
- { "models/buildables/hivemind/hivemind.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Droid Hivemind", //pickup
- 0,
- IT_BUILDABLE,
- BA_D_HIVEMIND,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_spawn (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human spawn item
-*/
- {
- "team_human_spawn",
- "sound/items/holdable.wav",
- { "models/buildables/replicator/replicator.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Spawn", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_SPAWN,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_def1 (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_def1",
- "sound/items/holdable.wav",
- { "models/buildables/plasmaturret/pturret_base.md3", "models/buildables/plasmaturret/pturret_top.md3", 0, 0 },
- "icons/teleporter", //icon
- "Human Defense", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_DEF1,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_def2 (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_def2",
- "sound/items/holdable.wav",
- { "models/buildables/plasmaturret/pturret_base.md3", "models/weapons2/machinegun/machinegun.md3", 0, 0 },
- "icons/teleporter", //icon
- "Human Defense2", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_DEF2,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_def3 (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_tesla",
- "sound/items/holdable.wav",
- { "models/buildables/tesla/tesla.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Tesla Generator", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_DEF3,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_mcu (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_mcu",
- "sound/items/holdable.wav",
- { "models/buildables/mcu/mcu.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human MCU", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_MCU,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_dcc (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_dcc",
- "sound/items/holdable.wav",
- { "models/buildables/dcc/dcc.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human DCC", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_DCC,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_medistat (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_medistat",
- "sound/items/holdable.wav",
- { "models/buildables/medistat/medistat.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Medistation", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_MEDISTAT,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_bank (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_bank",
- "sound/items/holdable.wav",
- { "models/buildables/bank/bank.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Bank", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_BANK,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_reactor (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human power item
-*/
- {
- "team_human_reactor",
- "sound/items/holdable.wav",
- { "models/buildables/reactor/reactor.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Reactor", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_REACTOR,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_repeater (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human power item
-*/
- {
- "team_human_repeater",
- "sound/items/holdable.wav",
- { "models/buildables/repeater/repeater.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Repeater", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_REPEATER,
- "", //precache
- "" //sounds
- },
-
-/*QUAKED team_human_floatmine (0 0 1) (-16 -16 -16) (16 16 16)
-TA: human defense item
-*/
- {
- "team_human_floatmine",
- "sound/items/holdable.wav",
- { "models/buildables/floatmine/floatmine.md3", 0, 0, 0 },
- "icons/teleporter", //icon
- "Human Floatmine", //pickup
- 0,
- IT_BUILDABLE,
- BA_H_FLOATMINE,
- "", //precache
- "" //sounds
- },
-
-
/*QUAKED upgrade_torch (0 0 1) (-16 -16 -16) (16 16 16)
*/
{
@@ -3453,27 +3180,6 @@ gitem_t *BG_FindItemForWeapon( weapon_t weapon ) {
/*
===============
-BG_FindItemForBuildable
-
-TA: new function for finding buildable items
-===============
-*/
-gitem_t *BG_FindItemForBuildable( buildable_t buildable ) {
- gitem_t *it;
-
- for ( it = bg_itemlist + 1 ; it->classname ; it++) {
- if ( it->giType == IT_BUILDABLE && it->giTag == buildable ) {
- return it;
- }
- }
-
- Com_Error( ERR_DROP, "Couldn't find item for buildable %i", buildable);
- return NULL;
-}
-
-
-/*
-===============
BG_FindItemForUpgrade
TA: new function for finding upgrade items
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 9663e884..2e2108e5 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -925,7 +925,6 @@ extern int bg_numItems;
gitem_t *BG_FindItem( const char *pickupName );
gitem_t *BG_FindItemForWeapon( weapon_t weapon );
-gitem_t *BG_FindItemForBuildable( buildable_t buildable );
gitem_t *BG_FindItemForUpgrade( upgrade_t upgrade );
gitem_t *BG_FindItemForPowerup( powerup_t pw );
gitem_t *BG_FindItemForHoldable( holdable_t pw );
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index e7ac1cbd..db94e03c 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1725,7 +1725,6 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
built->s.eType = ET_BUILDABLE;
built->classname = BG_FindEntityNameForBuildable( buildable );
- built->item = BG_FindItemForBuildable( buildable );
built->s.modelindex = buildable; //so we can tell what this is on the client side
built->biteam = built->s.modelindex2 = BG_FindTeamForBuildable( buildable );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index d99013b1..2aeada05 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -266,7 +266,7 @@ void Cmd_Give_f (gentity_t *ent)
}
// spawn a specific item right on the player
- if ( !give_all ) {
+/* if ( !give_all ) {
it = BG_FindItem (name);
if (!it) {
return;
@@ -282,7 +282,7 @@ void Cmd_Give_f (gentity_t *ent)
if (it_ent->inuse) {
G_FreeEntity( it_ent );
}
- }
+ }*/
}
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 7ad59093..1a4f6982 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -505,8 +505,8 @@ void PrecacheItem (gitem_t *it);
gentity_t *Drop_Item( gentity_t *ent, gitem_t *item, float angle );
gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity );
void SetRespawn (gentity_t *ent, float delay);
-void G_SpawnItem (gentity_t *ent, gitem_t *item);
-void FinishSpawningItem( gentity_t *ent );
+void G_SpawnBuildable(gentity_t *ent, buildable_t buildable);
+void FinishSpawningBuildable( gentity_t *ent );
void Think_Weapon (gentity_t *ent);
int ArmorIndex (gentity_t *ent);
void Add_Ammo (gentity_t *ent, int weapon, int count);
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index 653f06de..adb90db9 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -292,36 +292,39 @@ Finds the spawn function for the entity and calls it,
returning qfalse if not found
===============
*/
-qboolean G_CallSpawn( gentity_t *ent ) {
- spawn_t *s;
- gitem_t *item;
+qboolean G_CallSpawn( gentity_t *ent )
+{
+ spawn_t *s;
+ gitem_t *item;
+ buildable_t buildable;
if ( !ent->classname ) {
G_Printf ("G_CallSpawn: NULL classname\n");
return qfalse;
}
- // check item spawn functions
- for ( item=bg_itemlist+1 ; item->classname ; item++ ) {
- if ( !strcmp(item->classname, ent->classname) ) {
- //TA: don't allow items to spawn (atleast for the time being - might need to later?)
- G_SpawnItem( ent, item );
- return qtrue;
- //return qfalse;
- }
+ //check buildable spawn functions
+ if( ( buildable = BG_FindBuildNumForEntityName( ent->classname ) ) != BA_NONE )
+ {
+ G_SpawnBuildable( ent, buildable );
+ return qtrue;
}
// check normal spawn functions
- for ( s=spawns ; s->name ; s++ ) {
- if ( !strcmp(s->name, ent->classname) ) {
- if( G_ItemDisabled(item) )
+ for( s = spawns; s->name; s++ )
+ {
+ if( !strcmp( s->name, ent->classname ) )
+ {
+ if( G_ItemDisabled( item ) )
return qfalse;
+
// found it
- s->spawn(ent);
+ s->spawn( ent );
return qtrue;
}
}
- G_Printf ("%s doesn't have a spawn function\n", ent->classname);
+
+ G_Printf( "%s doesn't have a spawn function\n", ent->classname );
return qfalse;
}