X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Foverkill%2Fokmachinegun.qc;h=d874304432182434b9be139c905ea9a8ae2865f1;hb=a9c8e78b3bd0db89cb261c7b7f7e94a7903240e0;hp=4327fa83b4f2bfffb413afd83161da2078c40537;hpb=b899cfaab2db2509d752455cc6e099c6c9c3884b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc index 4327fa83b..d87430443 100644 --- a/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc +++ b/qcsrc/common/mutators/mutator/overkill/okmachinegun.qc @@ -263,17 +263,24 @@ METHOD(OverkillMachineGun, wr_think, void(entity thiswep, entity actor, .entity METHOD(OverkillMachineGun, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity)) { float ammo_amount; - if(WEP_CVAR(okmachinegun, mode) == 1) - ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(okmachinegun, sustained_ammo); + if (WEP_CVAR(okmachinegun, mode) == 1) + { + ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(okmachinegun, sustained_ammo); + } else - ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(okmachinegun, first_ammo); - - if(WEP_CVAR(okmachinegun, reload_ammo)) { - if(WEP_CVAR(okmachinegun, mode) == 1) + ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(okmachinegun, first_ammo); + } + if (WEP_CVAR(okmachinegun, reload_ammo)) + { + if (WEP_CVAR(okmachinegun, mode) == 1) + { ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_MACHINEGUN.m_id]) >= WEP_CVAR(okmachinegun, sustained_ammo); + } else + { ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_MACHINEGUN.m_id]) >= WEP_CVAR(okmachinegun, first_ammo); + } } return ammo_amount; } @@ -281,17 +288,24 @@ METHOD(OverkillMachineGun, wr_checkammo1, bool(entity thiswep, entity actor, .en METHOD(OverkillMachineGun, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity)) { float ammo_amount; - if(WEP_CVAR(okmachinegun, mode) == 1) - ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(okmachinegun, burst_ammo); + if (WEP_CVAR(okmachinegun, mode) == 1) + { + ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(okmachinegun, burst_ammo); + } else - ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(okmachinegun, first_ammo); - - if(WEP_CVAR(okmachinegun, reload_ammo)) { - if(WEP_CVAR(okmachinegun, mode) == 1) + ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(okmachinegun, first_ammo); + } + if (WEP_CVAR(okmachinegun, reload_ammo)) + { + if (WEP_CVAR(okmachinegun, mode) == 1) + { ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_MACHINEGUN.m_id]) >= WEP_CVAR(okmachinegun, burst_ammo); + } else + { ammo_amount += actor.(weaponentity).(weapon_load[WEP_OVERKILL_MACHINEGUN.m_id]) >= WEP_CVAR(okmachinegun, first_ammo); + } } return ammo_amount; }