X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fsv_onslaught.qc;h=ec5e79cf73b72eeb65d45568c8942dd5d609d17a;hp=0150de3925ee90072b040e2f5d132cd301a736ad;hb=5aab6120acfc624751d20a695d1b911b3e919831;hpb=ecd018b0f2a99be972759503e3efea35b6717ee9 diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 0150de392..ec5e79cf7 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -38,9 +38,7 @@ bool clientcamera_send(entity this, entity to, int sf) { WriteHeader(MSG_ENTITY, ENT_ONSCAMERA); - WriteCoord(MSG_ENTITY, this.origin_x); - WriteCoord(MSG_ENTITY, this.origin_y); - WriteCoord(MSG_ENTITY, this.origin_z); + WriteVector(MSG_ENTITY, this.origin); WriteAngle(MSG_ENTITY, this.angles_x); WriteAngle(MSG_ENTITY, this.angles_y); @@ -68,7 +66,7 @@ void ons_CaptureShield_Touch(entity this, entity toucher) vector mymid = (this.absmin + this.absmax) * 0.5; vector theirmid = (toucher.absmin + toucher.absmax) * 0.5; - Damage(toucher, this, this, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(theirmid - mymid) * ons_captureshield_force); + Damage(toucher, this, this, 0, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, mymid, normalize(theirmid - mymid) * ons_captureshield_force); if(IS_REAL_CLIENT(toucher)) { @@ -272,15 +270,11 @@ bool ons_Link_Send(entity this, entity to, int sendflags) WriteByte(MSG_ENTITY, sendflags); if(sendflags & 1) { - WriteCoord(MSG_ENTITY, this.goalentity.origin_x); - WriteCoord(MSG_ENTITY, this.goalentity.origin_y); - WriteCoord(MSG_ENTITY, this.goalentity.origin_z); + WriteVector(MSG_ENTITY, this.goalentity.origin); } if(sendflags & 2) { - WriteCoord(MSG_ENTITY, this.enemy.origin_x); - WriteCoord(MSG_ENTITY, this.enemy.origin_y); - WriteCoord(MSG_ENTITY, this.enemy.origin_z); + WriteVector(MSG_ENTITY, this.enemy.origin); } if(sendflags & 4) { @@ -381,7 +375,7 @@ int ons_ControlPoint_Attackable(entity cp, int teamnumber) return 0; } -void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) +void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { if(damage <= 0) { return; } @@ -479,7 +473,7 @@ void ons_ControlPoint_Icon_Think(entity this) this.SendFlags |= CPSF_STATUS; if(this.health <= 0) { - ons_ControlPoint_Icon_Damage(this, this, this, 1, 0, this.origin, '0 0 0'); + ons_ControlPoint_Icon_Damage(this, this, this, 1, 0, DMG_NOWEP, this.origin, '0 0 0'); return; } } @@ -868,7 +862,7 @@ void ons_camSetup(entity this) WriteAngle(MSG_ALL, cam.angles_z); } -void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) +void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { if(damage <= 0) return; if(warmup_stage || game_stopped) return; @@ -1155,7 +1149,7 @@ bool Onslaught_CheckWinner() else d = d * tmp_entity.max_health / max(30, 60 * autocvar_timelimit_suddendeath); - Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER.m_id, tmp_entity.origin, '0 0 0'); + Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, tmp_entity.origin, '0 0 0'); tmp_entity.sprite.SendFlags |= 16; @@ -1235,7 +1229,7 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector // Needs weapons? int c = 0; FOREACH(Weapons, it != WEP_Null, { - if(this.weapons & (it.m_wepset)) + if(STAT(WEAPONS, this) & (it.m_wepset)) if(++c >= 4) break; }); @@ -1254,7 +1248,7 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector { // gather health and armor only if (it.solid) - if ( ((it.health || it.armorvalue) && needarmor) || (it.weapons && needweapons ) ) + if ( ((it.health || it.armorvalue) && needarmor) || (STAT(WEAPONS, it) && needweapons ) ) if (vdist(it.origin - org, <, sradius)) { int t = it.bot_pickupevalfunc(this, it); @@ -1488,16 +1482,16 @@ void havocbot_role_ons_offense(entity this) if(this.havocbot_attack_time>time) return; - if (this.bot_strategytime < time) + if (navigation_goalrating_timeout(this)) { navigation_goalrating_start(this); - havocbot_goalrating_enemyplayers(this, 20000, this.origin, 650); + havocbot_goalrating_enemyplayers(this, 10000, this.origin, 650); if(!havocbot_goalrating_ons_generator_attack(this, 20000)) havocbot_goalrating_ons_controlpoints_attack(this, 20000); havocbot_goalrating_ons_offenseitems(this, 10000, this.origin, 10000); navigation_goalrating_end(this); - this.bot_strategytime = time + autocvar_bot_ai_strategyinterval; + navigation_goalrating_timeout_set(this); } }