this.team = this.enemy.team;
}
-void ons_CaptureShield_Spawn(entity generator, bool is_generator)
+void ons_CaptureShield_Spawn(entity this, Model shield_model)
{
entity shield = new(ons_captureshield);
IL_PUSH(g_onsshields, shield);
- shield.enemy = generator;
- shield.team = generator.team;
- shield.colormap = generator.colormap;
+ shield.enemy = this;
+ shield.team = this.team;
+ shield.colormap = this.colormap;
shield.reset = ons_CaptureShield_Reset;
settouch(shield, ons_CaptureShield_Touch);
setcefc(shield, ons_CaptureShield_Customize);
set_movetype(shield, MOVETYPE_NOCLIP);
shield.solid = SOLID_TRIGGER;
shield.avelocity = '7 0 11';
- shield.scale = 1;
- shield.model = ((is_generator) ? "models/onslaught/generator_shield.md3" : "models/onslaught/controlpoint_shield.md3");
+ shield.scale = this.scale;
- precache_model(shield.model);
- setorigin(shield, generator.origin);
- _setmodel(shield, shield.model);
- setsize(shield, shield.scale * shield.mins, shield.scale * shield.maxs);
+ float shield_extra_size = 1.20; // hitbox is 20% larger than the object itself
+ setorigin(shield, this.origin);
+ setmodel(shield, shield_model);
+ setsize(shield, shield_extra_size * this.mins, shield_extra_size * this.maxs);
}
onslaught_updatelinks();
// captureshield setup
- ons_CaptureShield_Spawn(this, false);
+ ons_CaptureShield_Spawn(this, MDL_ONS_CP_SHIELD);
CSQCMODEL_AUTOINIT(this);
}
this.bot_basewaypoint = this.nearestwaypoint;
// captureshield setup
- ons_CaptureShield_Spawn(this, true);
+ ons_CaptureShield_Spawn(this, MDL_ONS_GEN_SHIELD);
onslaught_updatelinks();