entity spawnmonster (string monster, float mnster, entity spawnedby, entity own, vector orig, float respwn, float moveflag)
{
- if(!spawncode_first_load)
- {
- initialize_field_db();
- spawncode_first_load = TRUE;
- }
+ // ensure spawnfunc database is initialized
+ initialize_field_db();
entity e = spawn();
self.takedamage = DAMAGE_NO;
setorigin(self, self.pos1);
self.angles = self.pos2;
- self.health = self.max_health; // TODO: check if resetting to max_health is wise here
+ self.health = self.max_health;
self.SendFlags |= MSF_MOVE;
self.SendFlags |= MSF_STATUS;
}
if(self.health <= 0)
- {
+ {
+ // Update one more time to avoid waypoint fading without emptying healthbar
if(self.sprite)
- {
- // Update one more time to avoid waypoint fading without emptying healthbar
WaypointSprite_UpdateHealth(self.sprite, 0);
- }
if(deathtype == DEATH_KILL)
self.candrop = FALSE; // killed by mobkill command
.float monster_attack;
float monster_skill;
-float spawncode_first_load; // used to tell the player the monster database is loading (TODO: fix this?)
.entity monster_owner; // new monster owner entity, fixes non-solid monsters
.float monstercount; // per player monster count