own.(weaponentity).m_switchweapon = w_getbestweapon(own, weaponentity);
}
}
- this.realowner.minelayer_mines -= 1;
+ this.realowner.(weaponentity).minelayer_mines -= 1;
delete(this);
}
own.(weaponentity).m_switchweapon = w_getbestweapon(own, weaponentity);
}
}
- this.realowner.minelayer_mines -= 1;
+ this.realowner.(weaponentity).minelayer_mines -= 1;
delete(this);
}
if(WarpZone_Projectile_Touch(this, toucher))
{
if(wasfreed(this))
- this.realowner.minelayer_mines -= 1;
+ {
+ .entity weaponentity = this.weaponentity_fld;
+ this.realowner.(weaponentity).minelayer_mines -= 1;
+ }
return;
}
// scan how many mines we placed, and return if we reached our limit
if(WEP_CVAR(minelayer, limit))
{
- if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
+ if(actor.(weaponentity).minelayer_mines >= WEP_CVAR(minelayer, limit))
{
// the refire delay keeps this message from being spammed
Send_Notification(NOTIF_ONE, actor, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
MUTATOR_CALLHOOK(EditProjectile, actor, mine);
- actor.minelayer_mines = W_MineLayer_Count(actor);
+ actor.(weaponentity).minelayer_mines = W_MineLayer_Count(actor);
}
bool W_MineLayer_PlacedMines(entity this, bool detonate)
METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
{
// aim and decide to fire if appropriate
- if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+ if(actor.(weaponentity).minelayer_mines >= WEP_CVAR(minelayer, limit))
PHYS_INPUT_BUTTON_ATCK(actor) = false;
else
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
}
METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
+ if(weaponslot(weaponentity) == 0)
+ actor.minelayer_mines = actor.(weaponentity).minelayer_mines;
+
if(autocvar_g_balance_minelayer_reload_ammo && actor.(weaponentity).clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
// not if we're holding the minelayer without enough ammo, but can detonate existing mines
METHOD(MineLayer, wr_resetplayer, void(entity thiswep, entity actor))
{
actor.minelayer_mines = 0;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ actor.(weaponentity).minelayer_mines = 0;
+ }
}
METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
// ============================
// Begin: Tag and rocket controllers
// ============================
-entity W_Seeker_Tagged_Info(entity isowner, entity istarget)
+entity W_Seeker_Tagged_Info(entity isowner, .entity weaponentity, entity istarget)
{
entity tag;
for(tag = NULL; (tag = find(tag, classname, "tag_tracker")); )
- if((tag.realowner == isowner) && (tag.tag_target == istarget))
+ if((tag.realowner == isowner) && (tag.tag_target == istarget) && (tag.weaponentity_fld == weaponentity))
return tag;
return NULL;
if(toucher.takedamage == DAMAGE_AIM && !IS_DEAD(toucher))
{
// check to see if this person is already tagged by me
- entity tag = W_Seeker_Tagged_Info(this.realowner, toucher);
+ .entity weaponentity = this.weaponentity_fld;
+ entity tag = W_Seeker_Tagged_Info(this.realowner, weaponentity, toucher);
if(tag != NULL)
{
METHOD(Seeker, wr_aim, void(entity thiswep, entity actor))
{
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
if(WEP_CVAR(seeker, type) == 1)
- if(W_Seeker_Tagged_Info(actor, actor.enemy) != NULL)
+ if(W_Seeker_Tagged_Info(actor, weaponentity, actor.enemy) != NULL)
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
else
PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);