Allow mapper-specified skinnum for items in default Lazarus and missionpack DLLs.

Allow mapper-specified model and count for health items in default Lazarus and missionpack DLLs.
This commit is contained in:
Knightmare66 2020-11-23 04:07:08 -05:00
parent 6564aca449
commit 93a2e256eb
2 changed files with 38 additions and 18 deletions

View file

@ -1577,7 +1577,8 @@ void SpawnItem (edict_t *ent, gitem_t *item)
ent->item = item;
ent->nextthink = level.time + 2 * FRAMETIME; // items start after other solids
ent->think = droptofloor;
ent->s.skinnum = item->world_model_skinnum; //Knightmare- skinnum specified in item table
if (!ent->s.skinnum) // Knightmare- allow mapper-specified skinnum
ent->s.skinnum = item->world_model_skinnum; // Knightmare- skinnum specified in item table
ent->s.effects = item->world_model_flags;
ent->s.renderfx = RF_GLOW;
@ -3160,8 +3161,10 @@ void SP_item_health (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH;
self->model = "models/items/healing/medium/tris.md2";
self->count = 10;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/medium/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 10;
// SpawnItem (self, FindItem ("Health"));
SpawnItem (self, FindItemByClassname ("item_health"));
gi.soundindex ("items/n_health.wav");
@ -3178,8 +3181,10 @@ void SP_item_health_small (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_SMALL;
self->model = "models/items/healing/stimpack/tris.md2";
self->count = sk_health_bonus_value->value;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/stimpack/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = sk_health_bonus_value->value;
// SpawnItem (self, FindItem ("Health"));
SpawnItem (self, FindItemByClassname ("item_health_small"));
self->style = HEALTH_IGNORE_MAX;
@ -3197,8 +3202,10 @@ void SP_item_health_large (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_LARGE;
self->model = "models/items/healing/large/tris.md2";
self->count = 25;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/large/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 25;
// SpawnItem (self, FindItem ("Health"));
SpawnItem (self, FindItemByClassname ("item_health_large"));
gi.soundindex ("items/l_health.wav");
@ -3215,8 +3222,10 @@ void SP_item_health_mega (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_MEGA;
self->model = "models/items/mega_h/tris.md2";
self->count = 100;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/mega_h/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 100;
// SpawnItem (self, FindItem ("Health"));
SpawnItem (self, FindItemByClassname ("item_health_mega"));
gi.soundindex ("items/m_health.wav");

View file

@ -2423,7 +2423,10 @@ void SpawnItem (edict_t *ent, gitem_t *item)
ent->item = item;
ent->nextthink = level.time + 2 * FRAMETIME; // items start after other solids
ent->think = droptofloor;
ent->s.skinnum = item->world_model_skinnum; // Knightmare- skinnum specified in item table
if (ent->skinnum) // Knightmare- use mapper-specified skinnum
ent->s.skinnum = ent->skinnum;
else
ent->s.skinnum = item->world_model_skinnum; // Knightmare- skinnum specified in item table
ent->s.effects = item->world_model_flags;
ent->s.renderfx = RF_GLOW;
if (ent->model)
@ -5003,8 +5006,10 @@ void SP_item_health (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH;
self->model = "models/items/healing/medium/tris.md2";
self->count = 10;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/medium/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 10;
SpawnItem (self, FindItem ("Health"));
gi.soundindex ("items/n_health.wav");
}
@ -5020,8 +5025,10 @@ void SP_item_health_small (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_SMALL;
self->model = "models/items/healing/stimpack/tris.md2";
self->count = sk_health_bonus_value->value; // Knightmare- made this cvar
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/stimpack/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = sk_health_bonus_value->value; // Knightmare- made this cvar
SpawnItem (self, FindItem ("Health"));
self->style = HEALTH_IGNORE_MAX;
gi.soundindex ("items/s_health.wav");
@ -5038,8 +5045,10 @@ void SP_item_health_large (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_LARGE;
self->model = "models/items/healing/large/tris.md2";
self->count = 25;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/healing/large/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 25;
SpawnItem (self, FindItem ("Health"));
gi.soundindex ("items/l_health.wav");
}
@ -5055,8 +5064,10 @@ void SP_item_health_mega (edict_t *self)
}
self->class_id = ENTITY_ITEM_HEALTH_MEGA;
self->model = "models/items/mega_h/tris.md2";
self->count = 100;
if (!self->model) // Knightmare- allow mapper-spcified model
self->model = "models/items/mega_h/tris.md2";
if (!self->count) // Knightmare- allow mapper-spcified count
self->count = 100;
SpawnItem (self, FindItem ("Health"));
gi.soundindex ("items/m_health.wav");
self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED;