X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fsv_onslaught.qc;h=223a81f7c4d4dfb6039a3ea6b2189b0df864dfd0;hp=e25d6ddd6b9d61ccc378b938e630f6629afe0be6;hb=7524c05918362f3348973a04533523e4df15d358;hpb=dbd2c0bd438d79c0a758e9d0127298e044781450 diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index e25d6ddd6b..223a81f7c4 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -143,8 +143,8 @@ void onslaught_updatelinks() { l.islinked = false; l.isshielded = true; - int i; - for(i = 0; i < 17; ++i) { l.isgenneighbor[i] = false; l.iscpneighbor[i] = false; } + l.aregensneighbor = 0; + l.arecpsneighbor = 0; LOG_DEBUG(etos(l), " (point) belongs to team ", ftos(l.team)); l.sprite.SendFlags |= 16; } @@ -188,9 +188,9 @@ void onslaught_updatelinks() l.enemy.isshielded = false; } if(l.goalentity.classname == "onslaught_generator") - l.enemy.isgenneighbor[l.goalentity.team] = true; + l.enemy.aregensneighbor |= BIT(l.goalentity.team); else - l.enemy.iscpneighbor[l.goalentity.team] = true; + l.enemy.arecpsneighbor |= BIT(l.goalentity.team); } if (l.enemy.islinked) { @@ -200,9 +200,9 @@ void onslaught_updatelinks() l.goalentity.isshielded = false; } if(l.enemy.classname == "onslaught_generator") - l.goalentity.isgenneighbor[l.enemy.team] = true; + l.goalentity.aregensneighbor |= BIT(l.enemy.team); else - l.goalentity.iscpneighbor[l.enemy.team] = true; + l.goalentity.arecpsneighbor |= BIT(l.enemy.team); } } // now update the generators @@ -328,8 +328,8 @@ void ons_DelayedLinkSetup(entity this) int ons_ControlPoint_CanBeLinked(entity cp, int teamnumber) { - if(cp.isgenneighbor[teamnumber]) { return 2; } - if(cp.iscpneighbor[teamnumber]) { return 1; } + if(cp.aregensneighbor & BIT(teamnumber)) return 2; + if(cp.arecpsneighbor & BIT(teamnumber)) return 1; return 0; } @@ -841,7 +841,7 @@ void ons_camSetup(entity this) float best_trace_fraction = 0; while(ang.y < 360) { - dir = eX * cos(ang.y * DEG2RAD) + eY * sin(ang.y * DEG2RAD); + dir = vec2(cos(ang.y * DEG2RAD), sin(ang.y * DEG2RAD)); dir *= 500; traceline(this.origin, this.origin - dir, MOVE_WORLDONLY, this); if(trace_fraction > best_trace_fraction) @@ -1039,6 +1039,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o gen.classname = "onslaught_generator"; gen.solid = SOLID_BBOX; gen.team_saved = teamnumber; + IL_PUSH(g_saved_team, gen); set_movetype(gen, MOVETYPE_NONE); gen.lasthealth = gen.max_health = gen.health = autocvar_g_onslaught_gen_health; gen.takedamage = DAMAGE_AIM; @@ -1195,6 +1196,7 @@ bool Onslaught_CheckWinner() nades_Clear(it); }); + game_stopped = true; return 1; } @@ -1306,7 +1308,7 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale continue; // Ignore owned controlpoints - if(!(cp2.isgenneighbor[this.team] || cp2.iscpneighbor[this.team])) + if(!((cp2.aregensneighbor & BIT(this.team)) || (cp2.arecpsneighbor & BIT(this.team)))) continue; // Count team mates interested in this control point