From: TimePath Date: Mon, 13 Jun 2016 04:34:40 +0000 (+1000) Subject: s/world/NULL/ X-Git-Tag: xonotic-v0.8.2~811 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=b9671f63469586007314131f3f53728795c035cd s/world/NULL/ --- diff --git a/qcsrc/client/commands/cl_cmd.qc b/qcsrc/client/commands/cl_cmd.qc index 45444c8791..dce058c816 100644 --- a/qcsrc/client/commands/cl_cmd.qc +++ b/qcsrc/client/commands/cl_cmd.qc @@ -92,7 +92,7 @@ void LocalCommand_boxparticles(int request, int argc) if (index <= 0) own = entitybyindex(-index); else - own = findfloat(world, entnum, index); + own = findfloat(NULL, entnum, index); vector org_from = stov(argv(3)); vector org_to = stov(argv(4)); vector dir_from = stov(argv(5)); diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 35f28bdca4..30148bdd44 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -389,7 +389,7 @@ void CSQCPlayer_FallbackFrame_Apply(entity this) void CSQCModel_AutoTagIndex_Apply(entity this) { if(this.tag_entity && wasfreed(this.tag_entity)) - this.tag_entity = world; + this.tag_entity = NULL; viewloc_SetTags(this); @@ -401,7 +401,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this) bool changed = 0; if(this.tag_entity.entnum != this.tag_networkentity) { - this.tag_entity = findfloat(world, entnum, this.tag_networkentity); + this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity); changed = 1; } @@ -431,7 +431,7 @@ void CSQCModel_AutoTagIndex_Apply(entity this) if(!this.tag_index) { // we need to prevent this from 'appening - this.tag_entity = world; + this.tag_entity = NULL; this.drawmask = 0; LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n"); } diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 5ffec682c0..f45a052aa1 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -642,7 +642,7 @@ void HUD_Panel_FirstInDrawQ(float id); void reset_tab_panels() { for (int i = 0; i < hud_panels_COUNT; ++i) - tab_panels[i] = world; + tab_panels[i] = NULL; } float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) { @@ -706,7 +706,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) highlightedAction = 0; HUD_Panel_FirstInDrawQ(highlightedPanel.panel_id); } - tab_panel = world; + tab_panel = NULL; reset_tab_panels(); } } @@ -778,7 +778,7 @@ LABEL(find_tab_panel) level = floor(tab_panel_pos.y / level_height) * level_height; //starting level candidate_pos.x = (!tab_backward) ? vid_conwidth : 0; start_posX = tab_panel_pos.x; - tab_panel = world; + tab_panel = NULL; k=0; while(++k) { @@ -805,11 +805,11 @@ LABEL(find_tab_panel) reset_tab_panels(); if (!old_tab_panel) { - tab_panel = world; + tab_panel = NULL; return true; } starting_panel = old_tab_panel; - old_tab_panel = world; + old_tab_panel = NULL; goto find_tab_panel; //u must find tab_panel! } if (!tab_backward) @@ -890,7 +890,7 @@ LABEL(find_tab_panel) cvar_set(strcat("hud_panel_", highlightedPanel_backup.panel_name, "_pos"), s); s = strcat(ftos(panel_size_backup.x/vid_conwidth), " ", ftos(panel_size_backup.y/vid_conheight)); cvar_set(strcat("hud_panel_", highlightedPanel_backup.panel_name, "_size"), s); - highlightedPanel_backup = world; + highlightedPanel_backup = NULL; } } else if(nPrimary == 's' && hudShiftState & S_CTRL) // save config @@ -1078,7 +1078,7 @@ void HUD_Panel_Highlight(float allow_move) return; } } - highlightedPanel = world; + highlightedPanel = NULL; highlightedAction = 0; } @@ -1108,7 +1108,7 @@ void HUD_Panel_Mouse() if (tab_panel) { //stop ctrl-tab selection - tab_panel = world; + tab_panel = NULL; reset_tab_panels(); } HUD_Panel_Highlight(mouseClicked & S_MOUSE1); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index 49a8fa5b7a..b07b84ed33 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -10,7 +10,7 @@ void HUD_UpdatePlayerTeams(); void HUD_Score_Rankings(vector pos, vector mySize, entity me) { float score; - entity tm = world, pl; + entity tm = NULL, pl; int SCOREPANEL_MAX_ENTRIES = 6; float SCOREPANEL_ASPECTRATIO = 2; int entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize.y/mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES); @@ -170,7 +170,7 @@ void HUD_Score() pl = pl.sort_next; if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST) if(pl.scores[ps_primary] == 0) - pl = world; + pl = NULL; score = me.(scores[ps_primary]); timer = TIME_ENCODED_TOSTRING(score); diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index b6cca28b14..c62a72e6e9 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -233,7 +233,7 @@ float SetTeam(entity o, int Team) case NUM_TEAM_4: break; default: - if(GetTeam(Team, false) == world) + if(GetTeam(Team, false) == NULL) { LOG_TRACEF("trying to switch to unsupported team %d\n", Team); Team = NUM_SPECTATOR; @@ -249,7 +249,7 @@ float SetTeam(entity o, int Team) case 0: break; default: - if(GetTeam(Team, false) == world) + if(GetTeam(Team, false) == NULL) { LOG_TRACEF("trying to switch to unsupported team %d\n", Team); Team = NUM_SPECTATOR; @@ -304,7 +304,7 @@ void Playerchecker_Think(entity this) // player disconnected SetTeam(e, -1); RemovePlayer(e); - e.sort_prev = world; + e.sort_prev = NULL; //e.gotscores = 0; } } diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 6773bd1553..bfc25e99c1 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -134,7 +134,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g string thelabel = mv_desc[id], ts; entity last = title; - entity next = world; + entity next = NULL; float nlines = 0; if( thelabel != "") { @@ -678,8 +678,8 @@ void MapVote_Init() for(i = 0; i < mv_num_maps; ++i ) mv_flags_start[i] = mv_flags[i]; - // Assume mv_pk3list is world, there should only be 1 mapvote per round - mv_pk3list = world; // I'm still paranoid! + // Assume mv_pk3list is NULL, there should only be 1 mapvote per round + mv_pk3list = NULL; // I'm still paranoid! for(i = 0; i < mv_num_maps; ++i) { diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 8c0bf14ea4..d3b3e46d73 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -124,7 +124,7 @@ entity GetTeam(int Team, bool add) if(teamslots[num]) return teamslots[num]; if (!add) - return world; + return NULL; entity tm = new_pure(team); tm.team = Team; teamslots[num] = tm; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index a7c4b1b87b..5cb3c18c1f 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -836,7 +836,7 @@ void HitSound() // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary // todo: normalize sound pressure levels? seems unnecessary - sound7(world, CH_INFO, SND(HIT), VOL_BASE, ATTN_NONE, pitch_shift * 100, 0); + sound7(NULL, CH_INFO, SND(HIT), VOL_BASE, ATTN_NONE, pitch_shift * 100, 0); } unaccounted_damage = 0; hitsound_time_prev = time; @@ -846,7 +846,7 @@ void HitSound() float typehit_time = STAT(TYPEHIT_TIME); if (COMPARE_INCREASING(typehit_time, typehit_time_prev) > autocvar_cl_hitsound_antispam_time) { - sound(world, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE); + sound(NULL, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE); typehit_time_prev = typehit_time; } } @@ -1461,7 +1461,7 @@ void CSQC_UpdateView(float w, float h) { float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0)); float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && STAT(ROUNDLOST)); - entity gen = world; + entity gen = NULL; float vehicle_viewdist = 0; vector vehicle_viewofs = '0 0 0'; diff --git a/qcsrc/common/effects/all.qc b/qcsrc/common/effects/all.qc index 73f1fe65fb..e69a03f729 100644 --- a/qcsrc/common/effects/all.qc +++ b/qcsrc/common/effects/all.qc @@ -28,7 +28,7 @@ NET_HANDLE(net_effect, bool isNew) eff_cnt = ReadByte(); if(eff_trail) - WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel); + WarpZone_TrailParticles(NULL, particleeffectnum(eff), v, vel); else pointparticles(eff, v, vel, eff_cnt); return true; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 078083cf92..c1144d2616 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -273,7 +273,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) if(DEATH_ISVEHICLE(w_deathtype)) { - traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); + traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL); if(trace_plane_normal != '0 0 0') w_backoff = trace_plane_normal; else @@ -347,7 +347,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) if(DEATH_ISTURRET(w_deathtype)) { - traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); + traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL); if(trace_plane_normal != '0 0 0') w_backoff = trace_plane_normal; else @@ -408,7 +408,7 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew) Weapon hitwep = DEATH_WEAPONOF(w_deathtype); w_random = prandom(); - traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world); + traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL); if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER) w_backoff = trace_plane_normal; else diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index b6ce6823dc..a2653238e7 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -105,7 +105,7 @@ o.y = ReadCoord(); o.z = ReadCoord(); // TODO: is this really what we want to be doing? Footsteps that follow the player at head height? - if (who == player_currententnum) e = findfloat(world, entnum, who); // play at camera position for full volume + if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume else if (e) e.origin = o; if (e) { @@ -136,7 +136,7 @@ o.x = ReadCoord(); o.y = ReadCoord(); o.z = ReadCoord(); - if (who == player_currententnum) e = findfloat(world, entnum, who); // play at camera position for full volume + if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume else if (e) e.origin = o; if (e) { diff --git a/qcsrc/common/effects/qc/globalsound.qh b/qcsrc/common/effects/qc/globalsound.qh index d4ec7f9937..44925cd510 100644 --- a/qcsrc/common/effects/qc/globalsound.qh +++ b/qcsrc/common/effects/qc/globalsound.qh @@ -132,7 +132,7 @@ entity GetVoiceMessage(string type); entity VM = def; \ int voicetype = VM.m_playersoundvt; \ bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \ - int flood = Say(this, ownteam, world, msg, true); \ + int flood = Say(this, ownteam, NULL, msg, true); \ bool fake; \ if (IS_SPEC(this) || IS_OBSERVER(this) || flood < 0) fake = true; \ else if (flood > 0) fake = false; \ diff --git a/qcsrc/common/effects/qc/lightningarc.qc b/qcsrc/common/effects/qc/lightningarc.qc index e7fea83db1..c1c3bb8872 100644 --- a/qcsrc/common/effects/qc/lightningarc.qc +++ b/qcsrc/common/effects/qc/lightningarc.qc @@ -59,7 +59,7 @@ void b_make(vector s,vector e, string t,float l,float z) int steps = min(16, floor(length / seglength)); if (steps < 1) { - te_lightning1(world, from, to); + te_lightning1(NULL, from, to); return; } @@ -73,18 +73,18 @@ void b_make(vector s,vector e, string t,float l,float z) float drift = drifts * (1 - (i / steps)) + drifte * (i / steps); vector dirnew = normalize(direction * (1 - drift) + randomvec() * drift); vector pos = pos_l + dirnew * steplength; - te_lightning1(world, pos_l, pos); + te_lightning1(NULL, pos_l, pos); // WTF endless recursion if branchfactor is 1.0 (possibly due to adding branchfactor_add). FIXME // if(random() < branchfactor) // cl_effects_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add); pos_l = pos; } - te_lightning1(world, pos_l, to); + te_lightning1(NULL, pos_l, to); } else { - te_lightning1(world, from, to); + te_lightning1(NULL, from, to); } } @@ -102,7 +102,7 @@ void b_make(vector s,vector e, string t,float l,float z) if (autocvar_cl_effects_lightningarc_simple) { - te_lightning1(world, from, to); + te_lightning1(NULL, from, to); } else { diff --git a/qcsrc/common/effects/qc/rubble.qh b/qcsrc/common/effects/qc/rubble.qh index 6b36b2c53e..7848b7b1f3 100644 --- a/qcsrc/common/effects/qc/rubble.qh +++ b/qcsrc/common/effects/qc/rubble.qh @@ -18,7 +18,7 @@ void RubbleLimit(string cname, float limit, void(entity) deleteproc) while (1) { e = findchain(classname, cname); - if (e == world) break; + if (e == NULL) break; // walk the list and count the entities, find the oldest // initialize our search with the first entity c = 1; diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 1c0fdaa983..46b4e03455 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -63,7 +63,7 @@ float nexball_mode; float OtherTeam(float t) //works only if there are two teams on the map! { entity e; - e = find(world, classname, "nexball_team"); + e = find(NULL, classname, "nexball_team"); if(e.team == t) e = find(e, classname, "nexball_team"); return e.team; @@ -87,7 +87,7 @@ void LogNB(string mode, entity actor) if(!autocvar_sv_eventlog) return; s = strcat(":nexball:", mode); - if(actor != world) + if(actor != NULL) s = strcat(s, ":", ftos(actor.playerid)); GameLogEcho(s); } @@ -150,7 +150,7 @@ void GiveBall(entity plyr, entity ball) if(ownr) { ownr.effects &= ~autocvar_g_nexball_basketball_effects_default; - ownr.ballcarried = world; + ownr.ballcarried = NULL; if(ownr.metertime) { ownr.metertime = 0; @@ -207,7 +207,7 @@ void DropBall(entity ball, vector org, vector vel) ball.effects &= ~EF_NOSHADOW; ball.owner.effects &= ~autocvar_g_nexball_basketball_effects_default; - setattachment(ball, world, ""); + setattachment(ball, NULL, ""); setorigin(ball, org); ball.movetype = MOVETYPE_BOUNCE; UNSET_ONGROUND(ball); @@ -226,11 +226,11 @@ void DropBall(entity ball, vector org, vector vel) } WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier); - WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please + WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT); - ball.owner.ballcarried = world; - ball.owner = world; + ball.owner.ballcarried = NULL; + ball.owner = NULL; } void InitBall(entity this) @@ -246,11 +246,11 @@ void InitBall(entity this) setthink(this, ResetBall); this.nextthink = time + autocvar_g_nexball_delay_idle + 3; this.teamtime = 0; - this.pusher = world; + this.pusher = NULL; this.team = false; _sound(this, CH_TRIGGER, this.noise1, VOL_BASE, ATTEN_NORM); WaypointSprite_Ping(this.waypointsprite_attachedforcarrier); - LogNB("init", world); + LogNB("init", NULL); } void ResetBall(entity this) @@ -264,7 +264,7 @@ void ResetBall(entity this) this.movetype = MOVETYPE_NOCLIP; this.velocity = '0 0 0'; // just in case? if(!this.cnt) - LogNB("resetidle", world); + LogNB("resetidle", NULL); this.cnt = 2; this.nextthink = time; } @@ -473,7 +473,7 @@ void nb_spawnteams() { bool t_red = false, t_blue = false, t_yellow = false, t_pink = false; entity e; - for(e = world; (e = find(e, classname, "nexball_goal"));) + for(e = NULL; (e = find(e, classname, "nexball_goal"));) { switch(e.team) { @@ -511,7 +511,7 @@ void nb_spawnteams() void nb_delayedinit(entity this) { - if(find(world, classname, "nexball_team") == world) + if(find(NULL, classname, "nexball_team") == NULL) nb_spawnteams(); nb_ScoreRules(nb_teams); } @@ -735,7 +735,7 @@ void W_Nexball_Touch(entity this) entity ball, attacker; attacker = this.owner; //this.think = func_null; - //this.enemy = world; + //this.enemy = NULL; PROJECTILE_TOUCH(this); if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal) @@ -769,7 +769,7 @@ void W_Nexball_Attack(entity actor, float t) return; W_SetupShot(actor, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0); - tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world); + tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL); if(trace_startsolid) { if(actor.metertime) @@ -968,7 +968,7 @@ MUTATOR_HOOKFUNCTION(nb, PlayerPreThink) if(player.ballcarried.wait < time && player.ballcarried.enemy) { //centerprint(player, sprintf("Lost lock on %s", player.ballcarried.enemy.netname)); - player.ballcarried.enemy = world; + player.ballcarried.enemy = NULL; } @@ -1118,7 +1118,7 @@ REGISTER_MUTATOR(nb, g_nexball) */ radar_showennemies = autocvar_g_nexball_radar_showallplayers; - InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE); WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; ActivateTeamplay(); diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc index 28ac85d79c..8389b22dae 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc @@ -111,7 +111,7 @@ void cpicon_construct(entity this) setmodel(this, MDL_ONS_CP); setsize(this, CPICON_MIN, CPICON_MAX); - if(this.icon_realmodel == world) + if(this.icon_realmodel == NULL) { this.icon_realmodel = spawn(); setmodel(this.icon_realmodel, MDL_Null); diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 0b99ee0227..2c52982709 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@ -416,8 +416,8 @@ void ons_Link_CheckUpdate(entity this) void ons_DelayedLinkSetup(entity this) { - this.goalentity = find(world, targetname, this.target); - this.enemy = find(world, targetname, this.target2); + this.goalentity = find(NULL, targetname, this.target); + this.enemy = find(NULL, targetname, this.target2); if(!this.goalentity) { objerror(this, "can not find target\n"); } if(!this.enemy) { objerror(this, "can not find target2\n"); } @@ -530,12 +530,12 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker { sound(this, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname); PlayerScore_Add(attacker, SP_ONS_TAKES, 1); PlayerScore_Add(attacker, SP_SCORE, 10); - this.owner.goalentity = world; + this.owner.goalentity = NULL; this.owner.islinked = false; this.owner.iscaptured = false; this.owner.team = 0; @@ -658,14 +658,14 @@ void ons_ControlPoint_Icon_BuildThink(entity this) if(IS_PLAYER(this.owner.ons_toucher)) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message); Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE), this.owner.message); Send_Notification(NOTIF_ONE, this.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, this.owner.message); PlayerScore_Add(this.owner.ons_toucher, SP_ONS_CAPS, 1); PlayerTeamScore_AddScore(this.owner.ons_toucher, 10); } - this.owner.ons_toucher = world; + this.owner.ons_toucher = NULL; onslaught_updatelinks(); @@ -824,14 +824,14 @@ void ons_ControlPoint_Reset(entity this) if(this.goalentity) remove(this.goalentity); - this.goalentity = world; + this.goalentity = NULL; this.team = 0; this.colormap = 1024; this.iscaptured = false; this.islinked = false; this.isshielded = true; setthink(this, ons_ControlPoint_Think); - this.ons_toucher = world; + this.ons_toucher = NULL; this.nextthink = time + ONS_CP_THINKRATE; setmodel_fixsize(this, MDL_ONS_CP_PAD1); @@ -978,10 +978,10 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d else { if (attacker == this) - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED_OVERTIME)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED_OVERTIME)); else { - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED)); PlayerScore_Add(attacker, SP_SCORE, 100); } this.iscaptured = false; @@ -1194,8 +1194,8 @@ bool Onslaught_CheckWinner() if (!wpforenemy_announced) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT); - sound(world, CH_INFO, SND_ONS_GENERATOR_DECAY, VOL_BASE, ATTEN_NONE); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT); + sound(NULL, CH_INFO, SND_ONS_GENERATOR_DECAY, VOL_BASE, ATTEN_NONE); wpforenemy_announced = true; } @@ -1238,14 +1238,14 @@ bool Onslaught_CheckWinner() if(winner_team > 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); TeamScore_AddToTeam(winner_team, ST_ONS_CAPS, +1); } else if(winner_team == -1) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED); } ons_stalemate = false; @@ -1395,7 +1395,7 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale // We'll consider only the best case bestvalue = 99999999999; - cp = world; + cp = NULL; for(cp1 = ons_worldcplist; cp1; cp1 = cp1.ons_worldcpnext) { if (!cp1.wpconsidered) @@ -1419,7 +1419,7 @@ void havocbot_goalrating_ons_controlpoints_attack(entity this, float ratingscale // Should be attacked // Rate waypoints near it found = false; - best = world; + best = NULL; bestvalue = 99999999999; for(radius=0; radius<1000 && !found; radius+=500) { @@ -1492,7 +1492,7 @@ bool havocbot_goalrating_ons_generator_attack(entity this, float ratingscale) // Should be attacked // Rate waypoints near it found = false; - bestwp = world; + bestwp = NULL; best = 99999999999; for(wp=findradius(g.origin,400); wp; wp=wp.chain) @@ -1584,7 +1584,7 @@ void havocbot_ons_reset_role(entity this) if(IS_DEAD(this)) return; - this.havocbot_ons_target = world; + this.havocbot_ons_target = NULL; // TODO: Defend control points or generator if necessary @@ -1598,14 +1598,14 @@ void havocbot_ons_reset_role(entity this) */ entity ons_Nearest_ControlPoint(entity this, vector pos, float max_dist) { - entity tmp_entity, closest_target = world; + entity tmp_entity, closest_target = NULL; tmp_entity = findchain(classname, "onslaught_controlpoint"); while(tmp_entity) { if(SAME_TEAM(tmp_entity, this)) if(tmp_entity.iscaptured) if(max_dist <= 0 || vdist(tmp_entity.origin - pos, <=, max_dist)) - if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == world) + if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == NULL) closest_target = tmp_entity; tmp_entity = tmp_entity.chain; } @@ -1614,7 +1614,7 @@ entity ons_Nearest_ControlPoint(entity this, vector pos, float max_dist) { if(SAME_TEAM(tmp_entity, this)) if(max_dist <= 0 || vdist(tmp_entity.origin - pos, <, max_dist)) - if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == world) + if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == NULL) closest_target = tmp_entity; tmp_entity = tmp_entity.chain; } @@ -1629,7 +1629,7 @@ entity ons_Nearest_ControlPoint(entity this, vector pos, float max_dist) */ entity ons_Nearest_ControlPoint_2D(entity this, vector pos, float max_dist) { - entity tmp_entity, closest_target = world; + entity tmp_entity, closest_target = NULL; vector delta; float smallest_distance = 0, distance; @@ -1643,7 +1643,7 @@ entity ons_Nearest_ControlPoint_2D(entity this, vector pos, float max_dist) if(SAME_TEAM(tmp_entity, this)) if(tmp_entity.iscaptured) if(max_dist <= 0 || distance <= max_dist) - if(closest_target == world || distance <= smallest_distance ) + if(closest_target == NULL || distance <= smallest_distance ) { closest_target = tmp_entity; smallest_distance = distance; @@ -1660,7 +1660,7 @@ entity ons_Nearest_ControlPoint_2D(entity this, vector pos, float max_dist) if(SAME_TEAM(tmp_entity, this)) if(max_dist <= 0 || distance <= max_dist) - if(closest_target == world || distance <= smallest_distance ) + if(closest_target == NULL || distance <= smallest_distance ) { closest_target = tmp_entity; smallest_distance = distance; @@ -1726,7 +1726,7 @@ bool ons_Teleport(entity player, entity tele_target, float range, bool tele_effe tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid) { - traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the world + traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the NULL if(trace_fraction == 1.0 && !trace_startsolid) { if ( tele_effects ) @@ -1804,7 +1804,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) if ( player.ons_spawn_by ) if ( ons_Teleport(player,player.ons_spawn_by,autocvar_g_onslaught_teleport_radius,false) ) { - player.ons_spawn_by = world; + player.ons_spawn_by = NULL; return false; } @@ -1812,7 +1812,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) if(random() <= autocvar_g_onslaught_spawn_at_controlpoints_chance) { float random_target = autocvar_g_onslaught_spawn_at_controlpoints_random; - entity tmp_entity, closest_target = world; + entity tmp_entity, closest_target = NULL; vector spawn_loc = player.ons_deathloc; // new joining player or round reset, don't bother checking @@ -1825,7 +1825,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) if(SAME_TEAM(tmp_entity, player)) if(random_target) RandomSelection_Add(tmp_entity, 0, string_null, 1, 1); - else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world) + else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL) closest_target = tmp_entity; } @@ -1844,7 +1844,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid) { - traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world + traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL if(trace_fraction == 1.0 && !trace_startsolid) { setorigin(player, loc); @@ -1860,7 +1860,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) if(random() <= autocvar_g_onslaught_spawn_at_generator_chance) { float random_target = autocvar_g_onslaught_spawn_at_generator_random; - entity tmp_entity, closest_target = world; + entity tmp_entity, closest_target = NULL; vector spawn_loc = player.ons_deathloc; // new joining player or round reset, don't bother checking @@ -1875,7 +1875,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) else { if(SAME_TEAM(tmp_entity, player)) - if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world) + if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL) closest_target = tmp_entity; } } @@ -1895,7 +1895,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn) tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player); if(trace_fraction == 1.0 && !trace_startsolid) { - traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world + traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL if(trace_fraction == 1.0 && !trace_startsolid) { setorigin(player, loc); @@ -1936,8 +1936,8 @@ MUTATOR_HOOKFUNCTION(ons, MonsterMove) { entity mon = M_ARGV(0, entity); - entity e = find(world, targetname, mon.target); - if (e != world) + entity e = find(NULL, targetname, mon.target); + if (e != NULL) mon.team = e.team; } @@ -1949,8 +1949,8 @@ void ons_MonsterSpawn_Delayed(entity this) if(own.targetname) { - entity e = find(world, target, own.targetname); - if(e != world) + entity e = find(NULL, target, own.targetname); + if(e != NULL) { own.team = e.team; @@ -1978,8 +1978,8 @@ void ons_TurretSpawn_Delayed(entity this) if(own.targetname) { - entity e = find(world, target, own.targetname); - if(e != world) + entity e = find(NULL, target, own.targetname); + if(e != NULL) { own.team = e.team; own.active = ACTIVE_NOT; @@ -2069,7 +2069,7 @@ MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand) entity closest_target = ons_Nearest_ControlPoint_2D(player, pos, autocvar_g_onslaught_click_radius); - if ( closest_target == world ) + if ( closest_target == NULL ) { sprint(player, "\nNo control point found\n"); return true; @@ -2175,8 +2175,8 @@ MUTATOR_HOOKFUNCTION(ons, TurretThink) // ONS uses somewhat backwards linking. if(turret.target) { - entity e = find(world, targetname, turret.target); - if (e != world) + entity e = find(NULL, targetname, turret.target); + if (e != NULL) turret.team = e.team; } @@ -2250,7 +2250,7 @@ spawnfunc(onslaught_generator) // scoreboard setup void ons_ScoreRules() { - CheckAllowedTeams(world); + CheckAllowedTeams(NULL); ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, 0, true); ScoreInfo_SetLabel_TeamScore (ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); @@ -2271,7 +2271,7 @@ void ons_Initialize() g_onslaught = true; ons_captureshield_force = autocvar_g_onslaught_shield_force; - InitializeEntity(world, ons_DelayedInit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, ons_DelayedInit, INITPRIO_GAMETYPE); } #endif diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 447e7730e2..2ec902f685 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -178,7 +178,7 @@ float MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, i MapInfo_ClearTemps(); // sometimes the glob isn't sorted nicely, so fix it here... - heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world); + heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, NULL); return 1; } @@ -206,7 +206,7 @@ void MapInfo_FilterString(string sf) MapInfo_ClearTemps(); // sometimes the glob isn't sorted nicely, so fix it here... - heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world); + heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, NULL); } void MapInfo_Filter_Free() diff --git a/qcsrc/common/minigames/cl_minigames.qc b/qcsrc/common/minigames/cl_minigames.qc index bff2b0aa13..3d3ef42dff 100644 --- a/qcsrc/common/minigames/cl_minigames.qc +++ b/qcsrc/common/minigames/cl_minigames.qc @@ -86,15 +86,15 @@ void deactivate_minigame() return; active_minigame.minigame_event(active_minigame,"deactivate"); - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, active_minigame)) ) if ( e.minigame_autoclean ) { minigame_autoclean_entity(e); } - minigame_self = world; - active_minigame = world; + minigame_self = NULL; + active_minigame = NULL; if ( auto_close_minigamemenu ) { @@ -134,7 +134,7 @@ void activate_minigame(entity minigame) } if ( minigame_self.owner != minigame ) - minigame_self = world; + minigame_self = NULL; active_minigame = minigame; active_minigame.minigame_event(active_minigame,"activate"); @@ -169,7 +169,7 @@ string ReadString_Zoned() { return strzone(ReadString_Raw()); } void minigame_read_owner(entity this) { string owner_name = ReadString_Raw(); - this.owner = world; + this.owner = NULL; do this.owner = find(this.owner,netname,owner_name); while ( this.owner && this.owner.classname != "minigame" ); @@ -185,7 +185,7 @@ NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew) this.netname = ReadString_Zoned(); } - entity minigame_ent = world; + entity minigame_ent = NULL; if ( this.classname == "minigame" ) { diff --git a/qcsrc/common/minigames/cl_minigames.qh b/qcsrc/common/minigames/cl_minigames.qh index 4359dba226..cc24d4bf0c 100644 --- a/qcsrc/common/minigames/cl_minigames.qh +++ b/qcsrc/common/minigames/cl_minigames.qh @@ -88,7 +88,7 @@ entity minigame_self; // Whethere there's an active minigame float minigame_isactive() { - return active_minigame != world; + return active_minigame != NULL; } // Execute a minigame command @@ -107,7 +107,7 @@ void HUD_MinigameMenu_CustomEntry(entity parent, string message, string event_ar #define FOREACH_MINIGAME_ENTITY(entityvar) \ - entityvar=world; \ + entityvar=NULL; \ while( (entityvar = findentity(entityvar,owner,active_minigame)) ) diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 6fc2400d35..f64ed44c84 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -25,7 +25,7 @@ bool HUD_mouse_over(entity somepanel) // Draws the minigame game board void HUD_MinigameBoard () { - entity hud_minigame = world; + entity hud_minigame = NULL; if(!autocvar__hud_configure) hud_minigame = active_minigame.descriptor; @@ -51,7 +51,7 @@ void HUD_MinigameBoard () // Draws the minigame status panel void HUD_MinigameStatus () { - entity hud_minigame = world; + entity hud_minigame = NULL; if(!autocvar__hud_configure) hud_minigame = active_minigame.descriptor; @@ -141,7 +141,7 @@ void HUD_MinigameMenu_EraseEntry ( entity e ) HUD_MinigameMenu_last_entry = e.list_prev; if ( HUD_MinigameMenu_activeitem == e ) - HUD_MinigameMenu_activeitem = world; + HUD_MinigameMenu_activeitem = NULL; remove(e); } @@ -186,9 +186,9 @@ bool HUD_MinigameMenu_Click_ExpandCollapse(entity this) { if ( HUD_MinigameMenu_activeitem && HUD_MinigameMenu_activeitem.owner == this ) - HUD_MinigameMenu_activeitem = world; + HUD_MinigameMenu_activeitem = NULL; this.flags &= ~2; - for ( e = this.list_next; e != world && e.owner == this; e = this.list_next ) + for ( e = this.list_next; e != NULL && e.owner == this; e = this.list_next ) { if ( e.flags & 2 ) HUD_MinigameMenu_Click(e); @@ -202,7 +202,7 @@ bool HUD_MinigameMenu_Click_ExpandCollapse(entity this) } else { - for ( e = HUD_MinigameMenu_entries; e != world; e = e.list_next ) + for ( e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next ) { if ( e.flags & 2 && e.origin_x == this.origin_x) HUD_MinigameMenu_Click(e); @@ -244,7 +244,7 @@ void HUD_MinigameMenu_ClickJoin(entity this, entity actor, entity trigger) { if ( HUD_MinigameMenu_Click_ExpandCollapse(this) ) { - entity e = world; + entity e = NULL; entity curr; entity prev = this; while( (e = find(e,classname,"minigame")) ) @@ -291,7 +291,7 @@ void HUD_MinigameMenu_ClickInvite(entity this, entity actor, entity trigger) for(int i = 0; i < maxclients; ++i) { if ( player_localnum != i && playerslots[i] && entcs_GetName(i) != "" && - !findfloat(world,minigame_playerslot,i+1) && playerslots[i].ping ) + !findfloat(NULL,minigame_playerslot,i+1) && playerslots[i].ping ) { e = HUD_MinigameMenu_SpawnSubEntry( strzone(entcs_GetName(i)), HUD_MinigameMenu_ClickInvite_Entry, @@ -348,14 +348,14 @@ void HUD_MinigameMenu_Close(entity this, entity actor, entity trigger) if ( HUD_MinigameMenu_IsOpened() ) { entity e, p; - for ( e = HUD_MinigameMenu_entries; e != world; e = p ) + for ( e = HUD_MinigameMenu_entries; e != NULL; e = p ) { p = e.list_next; remove(e); } - HUD_MinigameMenu_entries = world; - HUD_MinigameMenu_last_entry = world; - HUD_MinigameMenu_activeitem = world; + HUD_MinigameMenu_entries = NULL; + HUD_MinigameMenu_last_entry = NULL; + HUD_MinigameMenu_activeitem = NULL; if(autocvar_hud_cursormode) if ( !autocvar__hud_configure ) setcursormode(0); @@ -368,7 +368,7 @@ void HUD_MinigameMenu_CurrentButton() entity e; if ( active_minigame ) { - for ( e = HUD_MinigameMenu_last_entry; e != world; e = e.list_prev ) + for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = e.list_prev ) if ( e.classname == "hud_minigamemenu_exit" ) { HUD_MinigameMenu_EraseEntry(e); @@ -384,7 +384,7 @@ void HUD_MinigameMenu_CurrentButton() else { entity p; - for ( e = HUD_MinigameMenu_last_entry; e != world; e = p.list_prev ) + for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = p.list_prev ) { p = e; if ( e.classname == "hud_minigamemenu_current" ) @@ -396,7 +396,7 @@ void HUD_MinigameMenu_CurrentButton() break; } } - for ( e = HUD_MinigameMenu_last_entry; e != world; e = e.list_prev ) + for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = e.list_prev ) if ( e.classname == "hud_minigamemenu_exit" ) return; entity exit = HUD_MinigameMenu_SpawnEntry( @@ -418,7 +418,7 @@ void HUD_MinigameMenu_Open() _("Join"),'0 0 0',hud_fontsize*1.5,'0.7 0.84 1', HUD_MinigameMenu_ClickJoin), HUD_MinigameMenu_last_entry ); HUD_MinigameMenu_CurrentButton(); - HUD_MinigameMenu_activeitem = world; + HUD_MinigameMenu_activeitem = NULL; if(autocvar_hud_cursormode) setcursormode(1); } @@ -441,9 +441,9 @@ void HUD_MinigameMenu_MouseInput() panel_pos_y += hud_fontsize_y*2; - HUD_MinigameMenu_activeitem = world; + HUD_MinigameMenu_activeitem = NULL; vector sz; - for ( e = HUD_MinigameMenu_entries; e != world; e = e.list_next ) + for ( e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next ) { sz = eX*panel_size_x + eY*e.size_y; if ( e.model ) @@ -493,7 +493,7 @@ void HUD_MinigameMenu () vector offset; float itemh; vector imgsz = '22 22 0'; // NOTE: if changed, edit where HUD_MinigameMenu_activeitem is selected - for ( entity e = HUD_MinigameMenu_entries; e != world; e = e.list_next ) + for ( entity e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next ) { color = e.colormod; diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 3483f93df0..db25c2959e 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -46,11 +46,11 @@ string autocvar_sv_minigames_bulldozer_startlevel = "level1"; // find same game piece given its tile name entity bd_find_piece(entity minig, string tile, bool check_target) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile && ((check_target) ? e.bd_tiletype == BD_TILE_TARGET : e.bd_tiletype != BD_TILE_TARGET) ) return e; - return world; + return NULL; } // check if the tile name is valid (15x15 grid) @@ -65,17 +65,17 @@ bool bd_valid_tile(string tile) entity bd_find_dozer(entity minig) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER ) return e; - return world; + return NULL; } void bd_check_winner(entity minig) { int total = 0, valid = 0; - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET ) { @@ -192,7 +192,7 @@ void bd_move(entity minigame, entity player, string dir) int dy = bound(-1, dys, 1); int moved = 0; - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER ) { @@ -375,7 +375,7 @@ void bd_reset_moves(entity minigame) #ifdef SVQC for(e = minigame.minigame_players; e; e = e.list_next) #elif defined(CSQC) - e = world; + e = NULL; while( (e = findentity(e,owner,minigame)) ) if ( e.classname == "minigame_player" ) #endif @@ -388,7 +388,7 @@ void bd_reset_moves(entity minigame) void bd_load_level(entity minigame); void bd_setup_pieces(entity minigame) { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { @@ -503,7 +503,7 @@ bool bd_save_level(entity minigame) if(minigame.bd_levelname && minigame.bd_levelname != "") { int target_count = 0, boulder_count = 0; - entity piece = world; + entity piece = NULL; while((piece = findentity(piece,owner,minigame))) if(piece.classname == "minigame_board_piece") if(piece.bd_tiletype == BD_TILE_BOULDER) @@ -528,7 +528,7 @@ bool bd_save_level(entity minigame) if(minigame.bd_nextlevel && minigame.bd_nextlevel != "" && fexists(strcat("minigames/bulldozer/storage_", minigame.bd_nextlevel, ".txt"))) fputs(file_get, strcat("nextlevel = \"", minigame.bd_nextlevel, "\"\n")); - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" ) { @@ -626,7 +626,7 @@ int bd_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { @@ -753,13 +753,13 @@ void bd_hud_board(vector pos, vector mySize) { if(e.bd_tiletype == BD_TILE_TARGET) { - e.bd_enemy = world; + e.bd_enemy = NULL; e.bd_enemy = bd_find_piece(active_minigame, e.netname, false); } else if(e.bd_tiletype == BD_TILE_BOULDER) { e.bd_hide = false; // reset either way - e.bd_hide = ((bd_find_piece(active_minigame, e.netname, true)) != world); + e.bd_hide = ((bd_find_piece(active_minigame, e.netname, true)) != NULL); } } } diff --git a/qcsrc/common/minigames/minigame/c4.qc b/qcsrc/common/minigames/minigame/c4.qc index 9b9d570855..3c2beacb6f 100644 --- a/qcsrc/common/minigames/minigame/c4.qc +++ b/qcsrc/common/minigames/minigame/c4.qc @@ -24,11 +24,11 @@ const int C4_TEAMS = 2; // find connect 4 piece given its tile name entity c4_find_piece(entity minig, string tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile ) return e; - return world; + return NULL; } // Checks if the given piece completes a row @@ -196,7 +196,7 @@ int c4_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index 2e3ee10d64..8f8e3da2ea 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -116,7 +116,7 @@ void nmm_spawn_tile_square( entity minig, int offset, int skip ) // Remove tiles of a NMM minigame void nmm_kill_tiles(entity minig) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_nmm_tile" ) { @@ -136,11 +136,11 @@ void nmm_init_tiles(entity minig) // Find a tile by its id entity nmm_find_tile(entity minig, string id) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_nmm_tile" && e.netname == id ) return e; - return world; + return NULL; } // Check whether two tiles are adjacent @@ -157,7 +157,7 @@ bool nmm_tile_adjacent(entity tile1, entity tile2) // Returns 1 if there is at least 1 free adjacent tile bool nmm_tile_canmove(entity tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,tile.owner) ) ) if ( e.classname == "minigame_nmm_tile" && !e.nmm_tile_piece && nmm_tile_adjacent(e,tile) ) @@ -198,14 +198,14 @@ entity nmm_find_piece(entity start, entity minigame, int teamn, int pieceflags) if ( e.classname == "minigame_board_piece" && (e.minigame_flags & pieceflags) && e.team == teamn ) return e; - return world; + return NULL; } // Count NMM pieces matching flags and team number int nmm_count_pieces(entity minigame, int teamn, int pieceflags) { int n = 0; - entity e = world; + entity e = NULL; while (( e = nmm_find_piece(e,minigame, teamn, pieceflags) )) n++; return n; @@ -251,8 +251,8 @@ int nmm_server_event(entity minigame, string event, ...) { entity e = ...(0,entity); int argc = ...(1,int); - entity tile = world; - entity piece = world; + entity tile = NULL; + entity piece = NULL; bool move_ok = false; if ( e && argc >= 2 && argv(0) == "move" && @@ -265,7 +265,7 @@ int nmm_server_event(entity minigame, string event, ...) } else if ( minigame.minigame_flags & NMM_TURN_PLACE ) { - piece = nmm_find_piece(world,minigame,e.team,NMM_PIECE_HOME); + piece = nmm_find_piece(NULL,minigame,e.team,NMM_PIECE_HOME); if ( !tile.nmm_tile_piece && piece ) { tile.nmm_tile_piece = piece; @@ -283,7 +283,7 @@ int nmm_server_event(entity minigame, string event, ...) entity tile2 = nmm_find_tile(minigame,argv(2)); if ( tile2 && nmm_tile_adjacent(tile,tile2) && !tile2.nmm_tile_piece ) { - tile.nmm_tile_piece = world; + tile.nmm_tile_piece = NULL; tile2.nmm_tile_piece = piece; piece.origin = tile2.origin; piece.SendFlags |= MINIG_SF_UPDATE; @@ -301,7 +301,7 @@ int nmm_server_event(entity minigame, string event, ...) entity tile2 = nmm_find_tile(minigame,argv(2)); if ( tile2 && !tile2.nmm_tile_piece ) { - tile.nmm_tile_piece = world; + tile.nmm_tile_piece = NULL; tile2.nmm_tile_piece = piece; piece.origin = tile2.origin; piece.SendFlags |= MINIG_SF_UPDATE; @@ -316,7 +316,7 @@ int nmm_server_event(entity minigame, string event, ...) piece = tile.nmm_tile_piece; if ( piece && piece.nmm_tile_piece.team != e.team ) { - tile.nmm_tile_piece = world; + tile.nmm_tile_piece = NULL; piece.minigame_flags = NMM_PIECE_DEAD; piece.SendFlags |= MINIG_SF_UPDATE; move_ok = true; @@ -337,7 +337,7 @@ int nmm_server_event(entity minigame, string event, ...) { minigame.minigame_flags = NMM_TURN_TAKE|e.team; int takemill = NMM_TURN_TAKEANY; - entity f = world; + entity f = NULL; while ( ( f = findentity(f,owner,minigame) ) ) if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece && f.nmm_tile_piece.team == nextteam && !nmm_in_mill(f) ) @@ -349,14 +349,14 @@ int nmm_server_event(entity minigame, string event, ...) } else { - if ( nmm_find_piece(world,minigame,nextteam,NMM_PIECE_HOME) ) + if ( nmm_find_piece(NULL,minigame,nextteam,NMM_PIECE_HOME) ) minigame.minigame_flags = NMM_TURN_PLACE|nextteam; else if ( npieces == 3 ) minigame.minigame_flags = NMM_TURN_FLY|nextteam; else { minigame.minigame_flags = NMM_TURN_WIN|e.team; - entity f = world; + entity f = NULL; while ( ( f = findentity(f,owner,minigame) ) ) if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece && f.nmm_tile_piece.team == nextteam && nmm_tile_canmove(f) ) @@ -514,7 +514,7 @@ void nmm_hud_status(vector pos, vector mySize) float piece_space = piece_sz_x + ( ts_x - 7 * piece_sz_x ) / 6; vector mypos; float piece_light = 1; - entity e = world; + entity e = NULL; mypos = pos; if ( (active_minigame.minigame_flags&NMM_TURN_TEAM) == 2 ) @@ -570,13 +570,13 @@ void nmm_make_move(entity minigame) if ( minigame.minigame_flags & (NMM_TURN_PLACE|NMM_TURN_TAKE) ) { minigame_cmd("move ",nmm_currtile.netname); - nmm_fromtile = world; + nmm_fromtile = NULL; } else if ( (minigame.minigame_flags & (NMM_TURN_MOVE|NMM_TURN_FLY)) ) { if ( nmm_fromtile == nmm_currtile ) { - nmm_fromtile = world; + nmm_fromtile = NULL; } else if ( nmm_currtile.nmm_tile_piece && nmm_currtile.nmm_tile_piece.team == minigame_self.team ) { @@ -585,12 +585,12 @@ void nmm_make_move(entity minigame) else if ( nmm_fromtile ) { minigame_cmd("move ",nmm_fromtile.netname," ",nmm_currtile.netname); - nmm_fromtile = world; + nmm_fromtile = NULL; } } } else - nmm_fromtile = world; + nmm_fromtile = NULL; } string nmm_turn_to_string(int turnflags) @@ -621,13 +621,13 @@ int nmm_client_event(entity minigame, string event, ...) { if ( event == "activate" ) { - nmm_fromtile = world; + nmm_fromtile = NULL; nmm_init_tiles(minigame); minigame.message = nmm_turn_to_string(minigame.minigame_flags); } else if ( event == "deactivate" ) { - nmm_fromtile = world; + nmm_fromtile = NULL; nmm_kill_tiles(minigame); } else if ( event == "key_pressed" && (minigame.minigame_flags&NMM_TURN_TEAM) == minigame_self.team ) @@ -641,7 +641,7 @@ int nmm_client_event(entity minigame, string event, ...) else { string tileid = nmm_currtile.netname; - nmm_currtile = world; + nmm_currtile = NULL; while ( !nmm_currtile ) { tileid = minigame_relative_tile(tileid,1,0,7,7); @@ -656,7 +656,7 @@ int nmm_client_event(entity minigame, string event, ...) else { string tileid = nmm_currtile.netname; - nmm_currtile = world; + nmm_currtile = NULL; while ( !nmm_currtile ) { tileid = minigame_relative_tile(tileid,-1,0,7,7); @@ -671,7 +671,7 @@ int nmm_client_event(entity minigame, string event, ...) else { string tileid = nmm_currtile.netname; - nmm_currtile = world; + nmm_currtile = NULL; while ( !nmm_currtile ) { tileid = minigame_relative_tile(tileid,0,1,7,7); @@ -686,7 +686,7 @@ int nmm_client_event(entity minigame, string event, ...) else { string tileid = nmm_currtile.netname; - nmm_currtile = world; + nmm_currtile = NULL; while ( !nmm_currtile ) { tileid = minigame_relative_tile(tileid,0,-1,7,7); @@ -709,7 +709,7 @@ int nmm_client_event(entity minigame, string event, ...) } else if ( event == "mouse_moved" ) { - nmm_currtile = world; + nmm_currtile = NULL; vector tile_pos; vector tile_size = minigame_hud_denormalize_size('1 1 0'/7,nmm_boardpos,nmm_boardsize); entity e; @@ -742,7 +742,7 @@ int nmm_client_event(entity minigame, string event, ...) if ( e.classname == "minigame_nmm_tile" ) { if ( e.nmm_tile_piece == sent ) - e.nmm_tile_piece = world; + e.nmm_tile_piece = NULL; if ( e.netname == tileid ) e.nmm_tile_piece = sent; } diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index ef3c700859..602cad22d3 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -209,8 +209,8 @@ void pong_ai_think(entity this) float distance; float next_distance; float min_distance = 1; - entity ball = world; - entity mayball = world; + entity ball = NULL; + entity mayball = NULL; while ( ( mayball = findentity(mayball,owner,this.owner) ) ) if ( mayball.classname == "pong_ball" ) { @@ -309,7 +309,7 @@ vector pong_team_to_paddlepos(int nteam) } // Spawns a pong paddle -// if real_player is world, the paddle is controlled by AI +// if real_player is NULL, the paddle is controlled by AI entity pong_paddle_spawn(entity minigame, int pl_team, entity real_player) { entity paddle = msle_spawn(minigame,"pong_paddle"); @@ -321,7 +321,7 @@ entity pong_paddle_spawn(entity minigame, int pl_team, entity real_player) paddle.mins = pong_team_to_box_halfsize(pl_team,-paddle.pong_length,-1/16); paddle.maxs = pong_team_to_box_halfsize(pl_team,paddle.pong_length,1/16); - if ( real_player == world ) + if ( real_player == NULL ) pong_ai_spawn(paddle); else paddle.realowner = real_player; @@ -352,7 +352,7 @@ int pong_server_event(entity minigame, string event, ...) int i; for ( i = 0; i < PONG_MAX_PLAYERS; i++ ) { - if ( minigame.pong_paddles[i] == world ) + if ( minigame.pong_paddles[i] == NULL ) { pong_paddle_spawn(minigame,i+1,player); return i+1; @@ -370,7 +370,7 @@ int pong_server_event(entity minigame, string event, ...) for ( i = 0; i < PONG_MAX_PLAYERS; i++ ) { paddle = minigame.pong_paddles[i]; - if ( paddle != world && paddle.realowner == player ) + if ( paddle != NULL && paddle.realowner == player ) { ai = pong_ai_spawn(paddle); ai.pong_score = player.minigame_players.pong_score; @@ -420,9 +420,9 @@ int pong_server_event(entity minigame, string event, ...) if ( minigame.minigame_flags & PONG_STATUS_WAIT ) for ( i = 0; i < PONG_MAX_PLAYERS; i++ ) { - if ( minigame.pong_paddles[i] == world ) + if ( minigame.pong_paddles[i] == NULL ) { - pong_paddle_spawn(minigame,i+1,world); + pong_paddle_spawn(minigame,i+1,NULL); return true; } } @@ -438,10 +438,10 @@ int pong_server_event(entity minigame, string event, ...) for ( i = PONG_MAX_PLAYERS-1; i >= 0; i-- ) { paddle = minigame.pong_paddles[i]; - if ( paddle != world && + if ( paddle != NULL && paddle.realowner.classname == "pong_ai" ) { - minigame.pong_paddles[i] = world; + minigame.pong_paddles[i] = NULL; remove(paddle.realowner); remove(paddle); return true; diff --git a/qcsrc/common/minigames/minigame/pp.qc b/qcsrc/common/minigames/minigame/pp.qc index a66a839677..7d4048d61b 100644 --- a/qcsrc/common/minigames/minigame/pp.qc +++ b/qcsrc/common/minigames/minigame/pp.qc @@ -29,11 +29,11 @@ const int PP_TILE_SIZE = 7; // find tic tac toe piece given its tile name entity pp_find_piece(entity minig, string tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile ) return e; - return world; + return NULL; } // check if the tile name is valid (3x3 grid) @@ -164,7 +164,7 @@ void pp_setup_pieces(entity minigame) } } - minigame.pp_curr_piece = world; + minigame.pp_curr_piece = NULL; } // request a new match @@ -183,7 +183,7 @@ void pp_next_match(entity minigame, entity player) { minigame.minigame_flags = PP_TURN_PLACE | minigame.pp_nexteam; minigame_server_sendflags(minigame,MINIG_SF_UPDATE); - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" ) remove(e); @@ -210,7 +210,7 @@ int pp_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { @@ -285,7 +285,7 @@ void pp_hud_board(vector pos, vector mySize) vector tile_size = minigame_hud_denormalize_size('1 1 0'/PP_TILE_SIZE,pos,mySize); vector tile_pos; - active_minigame.pp_curr_piece = world; + active_minigame.pp_curr_piece = NULL; entity e; FOREACH_MINIGAME_ENTITY(e) if(e.classname == "minigame_board_piece") diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index 4eb0009b9d..2a612c599a 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -13,17 +13,17 @@ const int PS_TILE_SIZE = 8; // find same game piece given its tile name entity ps_find_piece(entity minig, string tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile ) return e; - return world; + return NULL; } bool ps_draw(entity minigame) { int valid = 0; - entity e = world; + entity e = NULL; while( ( e = findentity(e,owner,minigame) ) ) if( e.classname == "minigame_board_piece" ) { @@ -69,7 +69,7 @@ bool ps_winning_piece(entity minigame) //int number = minigame_tile_number(piece.netname); //int letter = minigame_tile_letter(piece.netname); - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" ) { @@ -227,7 +227,7 @@ int ps_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { @@ -506,7 +506,7 @@ void ps_make_move(entity minigame) else { minigame_cmd("move ", ps_curr_piece.netname, " ", ps_curr_pos); - ps_curr_piece = world; + ps_curr_piece = NULL; } } } @@ -528,7 +528,7 @@ int ps_client_event(entity minigame, string event, ...) case "activate": { ps_set_curr_pos(""); - ps_curr_piece = world; + ps_curr_piece = NULL; minigame.message = ps_turn_to_string(minigame.minigame_flags); return false; } diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index 98729092cc..617ed957ca 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -38,7 +38,7 @@ int autocvar_sv_minigames_snake_lives = 3; bool snake_alone(entity minig) { int headcount = 0; - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.cnt == 1 ) ++headcount; @@ -49,21 +49,21 @@ bool snake_alone(entity minig) // find same game piece given its tile name entity snake_find_piece(entity minig, string tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile ) return e; - return world; + return NULL; } // find same game piece given its cnt entity snake_find_cnt(entity minig, int steam, int tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.cnt == tile && e.team == steam ) return e; - return world; + return NULL; } // check if the tile name is valid (15x15 grid) @@ -78,11 +78,11 @@ bool snake_valid_tile(string tile) entity snake_find_head(entity minig, int steam) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.cnt == 1 && e.team == steam ) return e; - return world; + return NULL; } void snake_new_mouse(entity minigame) @@ -94,7 +94,7 @@ void snake_new_mouse(entity minigame) { string pos = minigame_tile_buildname(i, j); if(!snake_find_piece(minigame, pos)) - RandomSelection_Add(world, 0, pos, 1, 1); + RandomSelection_Add(NULL, 0, pos, 1, 1); } entity piece = msle_spawn(minigame,"minigame_board_piece"); @@ -174,15 +174,15 @@ void minigame_setup_snake(entity minigame, int pteam) { string pos = minigame_tile_buildname(i, j); if(!snake_find_piece(minigame, pos)) - RandomSelection_Add(world, 0, pos, 1, 1); + RandomSelection_Add(NULL, 0, pos, 1, 1); } entity piece = msle_spawn(minigame,"minigame_board_piece"); piece.team = pteam; piece.netname = strzone(RandomSelection_chosen_string); piece.cnt = 1; - piece.snake_next = world; - piece.snake_prev = world; + piece.snake_next = NULL; + piece.snake_prev = NULL; piece.snake_last = piece; setthink(piece, snake_head_think); piece.snake_delay = autocvar_sv_minigames_snake_delay_initial; @@ -203,13 +203,13 @@ entity snake_get_player(entity minigame, int pteam) #ifdef SVQC for(e = minigame.minigame_players; e; e = e.list_next) #elif defined(CSQC) - e = world; + e = NULL; while( (e = findentity(e,owner,minigame)) ) if ( e.classname == "minigame_player" ) #endif if(e.team == pteam) return e; - return world; + return NULL; } void snake_add_score(entity minigame, int pteam, int thescore) @@ -255,7 +255,7 @@ void snake_move_body(entity minigame, entity head, bool ate_mouse) piece.team = head.team; piece.snake_prev = tail; piece.snake_dir = tail.snake_dir; - piece.snake_next = world; + piece.snake_next = NULL; piece.snake_tail = true; piece.netname = strzone(tail.netname); @@ -282,7 +282,7 @@ void snake_eat_team(entity minigame, int pteam) head.nextthink = time + 1; // make sure they don't to eat us somehow - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" && e.cnt && e.team == pteam ) { @@ -420,7 +420,7 @@ int snake_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index cd9565abd5..b5248467f5 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -25,11 +25,11 @@ const int TTT_TILE_SIZE = 3; // find tic tac toe piece given its tile name entity ttt_find_piece(entity minig, string tile) { - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minig) ) ) if ( e.classname == "minigame_board_piece" && e.netname == tile ) return e; - return world; + return NULL; } // Checks if the given piece completes a row @@ -120,7 +120,7 @@ void ttt_next_match(entity minigame, entity player) minigame.minigame_flags = TTT_TURN_PLACE | minigame.ttt_nexteam; minigame_server_sendflags(minigame,MINIG_SF_UPDATE); minigame.ttt_npieces = 0; - entity e = world; + entity e = NULL; while ( ( e = findentity(e,owner,minigame) ) ) if ( e.classname == "minigame_board_piece" ) remove(e); @@ -142,7 +142,7 @@ int ttt_server_event(entity minigame, string event, ...) } case "end": { - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame)) ) if(e.classname == "minigame_board_piece") { @@ -417,7 +417,7 @@ int ttt_ai_random(int piecemask) for ( int i = 0; i < 9; i++ ) { if ( piecemask & f ) - RandomSelection_Add(world, f, string_null, 1, 1); + RandomSelection_Add(NULL, f, string_null, 1, 1); f <<= 1; } @@ -469,7 +469,7 @@ void ttt_aimove(entity minigame) { if ( minigame.minigame_flags == (TTT_TURN_PLACE|minigame.ttt_ai) ) { - entity aiplayer = world; + entity aiplayer = NULL; while ( ( aiplayer = findentity(aiplayer,owner,minigame) ) ) if ( aiplayer.classname == "minigame_player" && !aiplayer.minigame_playerslot ) break; diff --git a/qcsrc/common/minigames/minigames.qc b/qcsrc/common/minigames/minigames.qc index 0ccbc0e922..227f3d9c63 100644 --- a/qcsrc/common/minigames/minigames.qc +++ b/qcsrc/common/minigames/minigames.qc @@ -127,7 +127,7 @@ int minigame_count_players(entity minigame) #ifdef SVQC for(e = minigame.minigame_players; e; e = e.list_next) #elif defined(CSQC) - e = world; + e = NULL; while( (e = findentity(e,owner,minigame)) ) if ( e.classname == "minigame_player" ) #endif diff --git a/qcsrc/common/minigames/sv_minigames.qc b/qcsrc/common/minigames/sv_minigames.qc index b9a7b78cf8..689ce83d02 100644 --- a/qcsrc/common/minigames/sv_minigames.qc +++ b/qcsrc/common/minigames/sv_minigames.qc @@ -2,8 +2,8 @@ void player_clear_minigame(entity player) { - player.active_minigame = world; - player.minigame_players = world; + player.active_minigame = NULL; + player.minigame_players = NULL; if ( IS_PLAYER(player) ) player.movetype = MOVETYPE_WALK; else @@ -18,7 +18,7 @@ void minigame_rmplayer(entity minigame_session, entity player) if ( p.minigame_players == player ) { - if ( p.list_next == world ) + if ( p.list_next == NULL ) { end_minigame(minigame_session); return; @@ -32,7 +32,7 @@ void minigame_rmplayer(entity minigame_session, entity player) } else { - for ( e = p.list_next; e != world; e = e.list_next ) + for ( e = p.list_next; e != NULL; e = e.list_next ) { if ( e.minigame_players == player ) { @@ -105,7 +105,7 @@ bool minigame_SendEntity(entity this, entity to, int sf) void minigame_resend(entity minigame) { minigame.SendFlags = MINIG_SF_ALL; - entity e = world; + entity e = NULL; while (( e = findentity(e,owner,minigame) )) { e.SendFlags = MINIG_SF_ALL; @@ -115,7 +115,7 @@ void minigame_resend(entity minigame) bool minigame_CheckSend(entity this) { entity e; - for ( e = this.owner.minigame_players; e != world; e = e.list_next ) + for ( e = this.owner.minigame_players; e != NULL; e = e.list_next ) if ( e.minigame_players == other ) return true; return false; @@ -163,7 +163,7 @@ int minigame_addplayer(entity minigame_session, entity player) entity start_minigame(entity player, string minigame ) { if ( !autocvar_sv_minigames || !IS_REAL_CLIENT(player) ) - return world; + return NULL; entity e = minigame_get_descriptor(minigame); if ( e ) @@ -178,7 +178,7 @@ entity start_minigame(entity player, string minigame ) { LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n"); end_minigame(minig); - return world; + return NULL; } Net_LinkEntity(minig, false, 0, minigame_SendEntity); @@ -193,23 +193,23 @@ entity start_minigame(entity player, string minigame ) return minig; } - return world; + return NULL; } entity join_minigame(entity player, string game_id ) { if ( !autocvar_sv_minigames || !IS_REAL_CLIENT(player) ) - return world; + return NULL; entity minig; - for ( minig = minigame_sessions; minig != world; minig = minig.list_next ) + for ( minig = minigame_sessions; minig != NULL; minig = minig.list_next ) { if ( minig.netname == game_id ) if ( minigame_addplayer(minig,player) ) return minig; } - return world; + return NULL; } void part_minigame(entity player ) @@ -231,7 +231,7 @@ void end_minigame(entity minigame_session) GameLogEcho(strcat(":minigame:end:",minigame_session.netname)); - entity e = world; + entity e = NULL; while( (e = findentity(e, owner, minigame_session)) ) if ( e.minigame_autoclean ) { @@ -240,7 +240,7 @@ void end_minigame(entity minigame_session) } entity p; - for ( e = minigame_session.minigame_players; e != world; e = p ) + for ( e = minigame_session.minigame_players; e != NULL; e = p ) { p = e.list_next; player_clear_minigame(e.minigame_players); @@ -282,12 +282,12 @@ string invite_minigame(entity inviter, entity player) entity minigame_find_player(entity client) { if ( ! client.active_minigame ) - return world; + return NULL; entity e; for ( e = client.active_minigame.minigame_players; e; e = e.list_next ) if ( e.minigame_players == client ) return e; - return world; + return NULL; } bool MinigameImpulse(entity this, int imp) @@ -343,7 +343,7 @@ void ClientCommand_minigame(entity caller, int request, int argc, string command else if ( minig_cmd == "list-sessions" ) { entity e; - for ( e = minigame_sessions; e != world; e = e.list_next ) + for ( e = minigame_sessions; e != NULL; e = e.list_next ) sprint(caller,e.netname,"\n"); return; } diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 247c6b8f4e..44d7121fcd 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -122,7 +122,7 @@ void M_Mage_Defend_Shield(entity this); bool M_Mage_Defend_Heal_Check(entity this, entity targ) { - if(targ == world) + if(targ == NULL) return false; if(targ.health <= 0) return false; @@ -152,10 +152,10 @@ void M_Mage_Attack_Spike_Explode(entity this) sound(this, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); - this.realowner.mage_spike = world; + this.realowner.mage_spike = NULL; Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1); - RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE.m_id, other); + RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, other); remove (this); } @@ -184,11 +184,11 @@ void M_Mage_Attack_Spike_Think(entity this) spd + (autocvar_g_monster_mage_attack_spike_accel) * frametime ); - if (this.enemy != world) + if (this.enemy != NULL) if (this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy)) - this.enemy = world; + this.enemy = NULL; - if (this.enemy != world) + if (this.enemy != NULL) { entity e = this.enemy; vector eorg = 0.5 * (e.absmin + e.absmax); @@ -307,7 +307,7 @@ void M_Mage_Defend_Heal(entity this) void M_Mage_Attack_Push(entity this) { sound(this, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM); - RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, this.enemy); + RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, this.enemy); Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1); setanim(this, this.anim_shoot, true, true, true); diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index 0d134941b4..7a11b139e4 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -93,7 +93,7 @@ void M_Shambler_Attack_Lightning_Explode(entity this) if(this.movetype == MOVETYPE_NONE) this.velocity = this.oldvelocity; - RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius), world, world, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, other); + RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius), NULL, NULL, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, other); for(head = findradius(this.origin, (autocvar_g_monster_shambler_attack_lightning_radius_zap)); head; head = head.chain) if(head != this.realowner) if(head.takedamage) { @@ -136,7 +136,7 @@ void M_Shambler_Attack_Lightning_Think(entity this) this.nextthink = time; if (time > this.cnt) { - other = world; + other = NULL; M_Shambler_Attack_Lightning_Explode(this); return; } diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index fe5bb7afb9..9338657082 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -141,7 +141,7 @@ void M_Spider_Attack_Web_Explode(entity this) if(this) { Send_Effect(EFFECT_ELECTRO_IMPACT, this.origin, '0 0 0', 1); - RadiusDamage(this, this.realowner, 0, 0, 25, world, world, 25, this.projectiledeathtype, world); + RadiusDamage(this, this.realowner, 0, 0, 25, NULL, NULL, 25, this.projectiledeathtype, NULL); for(entity e = findradius(this.origin, 25); e; e = e.chain) if(e != this) if(e.takedamage && !IS_DEAD(e)) if(e.health > 0) if(e.monsterid != MON_SPIDER.monsterid) e.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime); diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index edfc92ba5a..001b2e24d8 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -105,7 +105,7 @@ void M_Wyvern_Attack_Fireball_Explode(entity this) entity own = this.realowner; - RadiusDamage(this, own, autocvar_g_monster_wyvern_attack_fireball_damage, autocvar_g_monster_wyvern_attack_fireball_edgedamage, autocvar_g_monster_wyvern_attack_fireball_force, world, world, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, world); + RadiusDamage(this, own, autocvar_g_monster_wyvern_attack_fireball_damage, autocvar_g_monster_wyvern_attack_fireball_edgedamage, autocvar_g_monster_wyvern_attack_fireball_force, NULL, NULL, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, NULL); FOREACH_ENTITY_FLOAT(takedamage, DAMAGE_AIM, { diff --git a/qcsrc/common/monsters/spawn.qc b/qcsrc/common/monsters/spawn.qc index 5e1af3df7d..23fc845ac7 100644 --- a/qcsrc/common/monsters/spawn.qc +++ b/qcsrc/common/monsters/spawn.qc @@ -24,7 +24,7 @@ entity spawnmonster (string monster, float monster_id, entity spawnedby, entity { RandomSelection_Init(); for(i = MON_FIRST; i <= MON_LAST; ++i) - RandomSelection_Add(world, i, string_null, 1, 1); + RandomSelection_Add(NULL, i, string_null, 1, 1); monster_id = RandomSelection_chosen_float; } diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 945a1de35e..c0a15e97b1 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -123,7 +123,7 @@ entity Monster_FindTarget(entity mon) { if(MUTATOR_CALLHOOK(MonsterFindTarget)) { return mon.enemy; } // Handled by a mutator - entity head, closest_target = world; + entity head, closest_target = NULL; head = findradius(mon.origin, mon.target_range); while(head) // find the closest acceptable target to pass to @@ -418,7 +418,7 @@ bool Monster_Attack_Leap(entity this, vector anm, void(entity this) touchfunc, v void Monster_Attack_Check(entity this, entity targ) { - if((this == world || targ == world) + if((this == NULL || targ == NULL) || (!this.monster_attackfunc) || (time < this.attack_finished_single[0]) ) { return; } @@ -468,7 +468,7 @@ void Monster_UpdateModel(entity this) void Monster_Touch(entity this) { - if(other == world) { return; } + if(other == NULL) { return; } if(other.monster_attack) if(this.enemy != other) @@ -555,7 +555,7 @@ vector Monster_Move_Target(entity this, entity targ) targ_origin = WarpZone_RefSys_TransformOrigin(this.enemy, this, targ_origin); // origin of target as seen by the monster (us) WarpZone_TraceLine(this.origin, targ_origin, MOVE_NOMONSTERS, this); - if((this.enemy == world) + if((this.enemy == NULL) || (IS_DEAD(this.enemy) || this.enemy.health < 1) || (STAT(FROZEN, this.enemy)) || (this.enemy.flags & FL_NOTARGET) @@ -564,13 +564,13 @@ vector Monster_Move_Target(entity this, entity targ) || (vdist(this.origin - targ_origin, >, this.target_range)) || ((trace_fraction < 1) && (trace_ent != this.enemy))) { - this.enemy = world; + this.enemy = NULL; this.pass_distance = 0; } if(this.enemy) { - /*WarpZone_TrailParticles(world, particleeffectnum(EFFECT_RED_PASS), this.origin, targ_origin); + /*WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_RED_PASS), this.origin, targ_origin); print("Trace origin: ", vtos(targ_origin), "\n"); print("Target origin: ", vtos(this.enemy.origin), "\n"); print("My origin: ", vtos(this.origin), "\n"); */ @@ -690,7 +690,7 @@ void Monster_CalculateVelocity(entity this, vector to, vector from, float turnra void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) { - if(this.target2) { this.goalentity = find(world, targetname, this.target2); } + if(this.target2) { this.goalentity = find(NULL, targetname, this.target2); } entity targ; @@ -706,7 +706,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) movelib_brake_simple(this, stpspeed); setanim(this, this.anim_idle, true, false, false); - this.enemy = world; + this.enemy = NULL; this.nextthink = time + this.ticrate; if(this.revive_progress >= 1) @@ -725,7 +725,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) movelib_brake_simple(this, stpspeed); setanim(this, this.anim_idle, true, false, false); - this.enemy = world; + this.enemy = NULL; this.nextthink = time + this.ticrate; if(this.health < 1) @@ -750,7 +750,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) { this.last_trace = time + 0.4; - Damage (this, world, world, 2, DEATH_DROWN.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, 2, DEATH_DROWN.m_id, this.origin, '0 0 0'); this.angles = '90 90 0'; if(random() < 0.5) { @@ -782,7 +782,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) if (MUTATOR_CALLHOOK(MonsterMove, this, runspeed, walkspeed, targ) || gameover - || this.draggedby != world + || this.draggedby != NULL || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) @@ -802,7 +802,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) if(teamplay) if(autocvar_g_monsters_teams) if(DIFF_TEAM(this.monster_follow, this)) - this.monster_follow = world; + this.monster_follow = NULL; if(time >= this.last_enemycheck) { @@ -866,7 +866,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) } else { - entity e = find(world, targetname, this.target2); + entity e = find(NULL, targetname, this.target2); if(e.target2) this.target2 = e.target2; else if(e.target) @@ -954,8 +954,8 @@ void Monster_Reset(entity this) this.health = this.max_health; this.velocity = '0 0 0'; - this.enemy = world; - this.goalentity = world; + this.enemy = NULL; + this.goalentity = NULL; this.attack_finished_single[0] = 0; this.moveto = this.origin; } @@ -1012,7 +1012,7 @@ void Monster_Dead(entity this, entity attacker, float gibbed) this.solid = SOLID_CORPSE; this.takedamage = DAMAGE_AIM; this.deadflag = DEAD_DEAD; - this.enemy = world; + this.enemy = NULL; this.movetype = MOVETYPE_TOSS; this.moveto = this.origin; settouch(this, Monster_Touch); // reset incase monster was pouncing @@ -1047,7 +1047,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage if(time < this.spawnshieldtime && deathtype != DEATH_KILL.m_id) return; - if(deathtype == DEATH_FALL.m_id && this.draggedby != world) + if(deathtype == DEATH_FALL.m_id && this.draggedby != NULL) return; vector v; @@ -1113,7 +1113,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage // don't check for enemies, just keep walking in a straight line void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff) { - if(gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != world || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time) + if(gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != NULL || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time) { mspeed = 0; if(time >= this.spawn_time) @@ -1266,7 +1266,7 @@ bool Monster_Spawn_Setup(entity this) if(autocvar_g_monsters_healthbars) { - entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), world, this.team, this, sprite, true, RADARICON_DANGER); + entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), NULL, this.team, this, sprite, true, RADARICON_DANGER); wp.wp_extra = this.monsterid; wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 0 0'); if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE)) @@ -1325,7 +1325,7 @@ bool Monster_Spawn(entity this, int mon_id) this.solid = SOLID_BBOX; this.movetype = MOVETYPE_WALK; this.spawnshieldtime = time + autocvar_g_monsters_spawnshieldtime; - this.enemy = world; + this.enemy = NULL; this.velocity = '0 0 0'; this.moveto = this.origin; this.pos1 = this.origin; diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 15aa8eeb13..ec1fadabe5 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -88,7 +88,7 @@ REGISTER_MUTATOR(buffs, cvar("g_buffs")) { MUTATOR_ONADD { - InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET); + InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET); } } @@ -169,7 +169,7 @@ bool buff_Waypoint_visible_for_player(entity this, entity player, entity view) void buff_Waypoint_Spawn(entity e) { entity buff = buff_FirstFromFlags(e.buffs); - entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_Buff); + entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team, e, buff_waypoint, true, RADARICON_Buff); wp.wp_extra = buff.m_id; WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod); e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player; @@ -255,7 +255,7 @@ void buff_Touch(entity this) { int buffid = buff_FirstFromFlags(other.buffs).m_id; //Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_DROP, other.buffs); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid); other.buffs = 0; //sound(other, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); @@ -294,7 +294,7 @@ void buff_NewType(entity ent, float cb) FOREACH(Buffs, buff_Available(it), LAMBDA( it.buff_seencount += 1; // if it's already been chosen, give it a lower priority - RandomSelection_Add(world, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount)); + RandomSelection_Add(NULL, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount)); )); ent.buffs = RandomSelection_chosen_float; } @@ -334,7 +334,7 @@ void buff_Think(entity this) if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || !(this.owner.buffs & this.buffs)) { buff_SetCooldown(this, autocvar_g_buffs_cooldown_respawn + frametime); - this.owner = world; + this.owner = NULL; if(autocvar_g_buffs_randomize) buff_NewType(this, this.buffs); @@ -381,7 +381,7 @@ void buff_Reset(entity this) { if(autocvar_g_buffs_randomize) buff_NewType(this, this.buffs); - this.owner = world; + this.owner = NULL; buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate); buff_Waypoint_Reset(this); this.buff_activetime_updated = false; @@ -690,7 +690,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDies) if(frag_target.buff_model) { remove(frag_target.buff_model); - frag_target.buff_model = world; + frag_target.buff_model = NULL; } } } @@ -721,7 +721,7 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) if(player.buffs & BUFF_SWAPPER.m_itemid) { float best_distance = autocvar_g_buffs_swapper_range; - entity closest = world; + entity closest = NULL; FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( if(!IS_DEAD(it) && !STAT(FROZEN, it) && !it.vehicle) if(DIFF_TEAM(it, player)) @@ -787,7 +787,7 @@ bool buffs_RemovePlayer(entity player) if(player.buff_model) { remove(player.buff_model); - player.buff_model = world; + player.buff_model = NULL; } // also reset timers here to prevent them continuing after spectating @@ -986,7 +986,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink) else { remove(player.buff_model); - player.buff_model = world; + player.buff_model = NULL; player.effects &= ~(EF_NOSHADOW); } @@ -1065,7 +1065,7 @@ MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsPrettyString) void buffs_DelayedInit(entity this) { if(autocvar_g_buffs_spawn_count > 0) - if(find(world, classname, "item_buff") == world) + if(find(NULL, classname, "item_buff") == NULL) { float i; for(i = 0; i < autocvar_g_buffs_spawn_count; ++i) diff --git a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc index 48b90ae7bb..191f616815 100644 --- a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc @@ -62,9 +62,9 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CAMPCHECK); if(player.vehicle) - Damage(player.vehicle, world, world, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, player.vehicle.origin, '0 0 0'); + Damage(player.vehicle, NULL, NULL, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, player.vehicle.origin, '0 0 0'); else - Damage(player, world, world, bound(0, autocvar_g_campcheck_damage, player.health + player.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, player.origin, '0 0 0'); + Damage(player, NULL, NULL, bound(0, autocvar_g_campcheck_damage, player.health + player.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, player.origin, '0 0 0'); } player.campcheck_nextcheck = time + autocvar_g_campcheck_interval; player.campcheck_traveled_distance = 0; diff --git a/qcsrc/common/mutators/mutator/instagib/instagib.qc b/qcsrc/common/mutators/mutator/instagib/instagib.qc index dc871d694a..34f3825680 100644 --- a/qcsrc/common/mutators/mutator/instagib/instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/instagib.qc @@ -218,7 +218,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) player.alpha = autocvar_g_instagib_invis_alpha; player.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha; player.items |= ITEM_Invisibility.m_itemid; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname); Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_INVISIBILITY); } } @@ -237,7 +237,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPowerups) if (time < player.invincible_finished) { player.items |= ITEM_Speed.m_itemid; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SPEED, player.netname); Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_SPEED); } } diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 8faebab0b0..c704d31ae2 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -383,7 +383,7 @@ void nade_ice_think(entity this) sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); RadiusDamage(this, this.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, - autocvar_g_nades_nade_radius, this, world, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy); + autocvar_g_nades_nade_radius, this, NULL, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy); Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this); } @@ -497,7 +497,7 @@ void nade_spawn_boom(entity this) if(this.realowner.nade_spawnloc) { remove(this.realowner.nade_spawnloc); - this.realowner.nade_spawnloc = world; + this.realowner.nade_spawnloc = NULL; } this.realowner.nade_spawnloc = spawnloc; @@ -651,7 +651,7 @@ void nade_boom(entity this) if(nade_blast) { RadiusDamage(this, this.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, - autocvar_g_nades_nade_radius, this, world, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy); + autocvar_g_nades_nade_radius, this, NULL, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy); Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this); } @@ -813,14 +813,14 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i void toss_nade(entity e, bool set_owner, vector _velocity, float _time) { - if(e.nade == world) + if(e.nade == NULL) return; entity _nade = e.nade; - e.nade = world; + e.nade = NULL; remove(e.fake_nade); - e.fake_nade = world; + e.fake_nade = NULL; makevectors(e.v_angle); @@ -836,7 +836,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1); //setmodel(_nade, MDL_PROJECTILE_NADE); - //setattachment(_nade, world, ""); + //setattachment(_nade, NULL, ""); PROJECTILE_MAKETRIGGER(_nade); if(STAT(NADES_SMALL, e)) setsize(_nade, '-8 -8 -8', '8 8 8'); @@ -867,7 +867,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) _nade.takedamage = DAMAGE_AIM; _nade.event_damage = nade_damage; setcefc(_nade, func_null); - _nade.exteriormodeltoclient = world; + _nade.exteriormodeltoclient = NULL; _nade.traileffectnum = 0; _nade.teleportable = true; _nade.pushable = true; @@ -1088,7 +1088,7 @@ void nades_Clear(entity player) if(player.fake_nade) remove(player.fake_nade); - player.nade = player.fake_nade = world; + player.nade = player.fake_nade = NULL; player.nade_timer = 0; } @@ -1197,7 +1197,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink) } float n = 0; - entity o = world; + entity o = NULL; if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout) n = -1; else @@ -1263,7 +1263,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn) if(player.nade_spawnloc.cnt <= 0) { remove(player.nade_spawnloc); - player.nade_spawnloc = world; + player.nade_spawnloc = NULL; } } } @@ -1321,7 +1321,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDamage_Calculate) Send_Effect(EFFECT_ICEORGLASS, frag_target.origin, '0 0 0', 3); M_ARGV(4, float) = 0; M_ARGV(6, vector) = '0 0 0'; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname); Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF); } } diff --git a/qcsrc/common/mutators/mutator/nix/nix.qc b/qcsrc/common/mutators/mutator/nix/nix.qc index 6f08a8e596..f52d75a9e9 100644 --- a/qcsrc/common/mutators/mutator/nix/nix.qc +++ b/qcsrc/common/mutators/mutator/nix/nix.qc @@ -95,7 +95,7 @@ void NIX_ChooseNextWeapon() RandomSelection_Init(); FOREACH(Weapons, it != WEP_Null, LAMBDA( if(NIX_CanChooseWeapon(it.m_id)) - RandomSelection_Add(world, it.m_id, string_null, 1, (it.m_id != nix_weapon)); + RandomSelection_Add(NULL, it.m_id, string_null, 1, (it.m_id != nix_weapon)); )); nix_nextweapon = RandomSelection_chosen_float; } diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index c8b964c372..90c671a609 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -55,7 +55,7 @@ void W_RocketPropelledChainsaw_Explode(entity this) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), world, world, WEP_CVAR(rpc, force), this.projectiledeathtype, other); + RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), NULL, NULL, WEP_CVAR(rpc, force), this.projectiledeathtype, other); remove (this); } diff --git a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc index 1adec77a79..10ec0cf5a8 100644 --- a/qcsrc/common/mutators/mutator/physical_items/physical_items.qc +++ b/qcsrc/common/mutators/mutator/physical_items/physical_items.qc @@ -92,7 +92,7 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) { entity item = M_ARGV(0, entity); - if(item.owner == world && autocvar_g_physical_items <= 1) + if(item.owner == NULL && autocvar_g_physical_items <= 1) return; if (item.spawnflags & 1) // floating item return; @@ -116,7 +116,7 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) wep.glowmod = item.owner.glowmod; wep.damageforcescale = autocvar_g_physical_items_damageforcescale; wep.dphitcontentsmask = item.dphitcontentsmask; - wep.cnt = (item.owner != world); + wep.cnt = (item.owner != NULL); setthink(wep, physical_item_think); wep.nextthink = time; diff --git a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc index 22127ad31f..bc4cb67752 100644 --- a/qcsrc/common/mutators/mutator/sandbox/sandbox.qc +++ b/qcsrc/common/mutators/mutator/sandbox/sandbox.qc @@ -80,7 +80,7 @@ void sandbox_ObjectFunction_Think(entity this) this.realowner = it; break; } - this.realowner = world; + this.realowner = NULL; )); this.nextthink = time; @@ -91,22 +91,22 @@ void sandbox_ObjectFunction_Think(entity this) .float old_solid, old_movetype; entity sandbox_ObjectEdit_Get(entity this, float permissions) { - // Returns the traced entity if the player can edit it, and world if not. + // Returns the traced entity if the player can edit it, and NULL if not. // If permissions if false, the object is returned regardless of editing rights. // Attached objects are SOLID_NOT and do not get traced. crosshair_trace_plusvisibletriggers(this); if(vdist(this.origin - trace_ent.origin, >, autocvar_g_sandbox_editor_distance_edit)) - return world; // out of trace range + return NULL; // out of trace range if(trace_ent.classname != "object") - return world; // entity is not an object + return NULL; // entity is not an object if(!permissions) return trace_ent; // don't check permissions, anyone can edit this object if(trace_ent.crypto_idfp == "") return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it if (!(trace_ent.realowner != this && autocvar_g_sandbox_editor_free < 2)) return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server - return world; + return NULL; } void sandbox_ObjectEdit_Scale(entity e, float f) @@ -143,14 +143,14 @@ void sandbox_ObjectAttach_Remove(entity e) // detaches any object attached to e entity head; - for(head = world; (head = find(head, classname, "object")); ) + for(head = NULL; (head = find(head, classname, "object")); ) { if(head.owner == e) { vector org; org = gettaginfo(head, 0); - setattachment(head, world, ""); - head.owner = world; + setattachment(head, NULL, ""); + head.owner = NULL; // objects change origin and angles when detached, so apply previous position setorigin(head, org); @@ -212,7 +212,7 @@ void sandbox_ObjectRemove(entity e) sandbox_ObjectAttach_Remove(e); // detach child objects // if the object being removed has been selected for attachment by a player, unset it - FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, LAMBDA(it.object_attach = world)); + FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, LAMBDA(it.object_attach = NULL)); if(e.material) { strunzone(e.material); e.material = string_null; } if(e.crypto_idfp) { strunzone(e.crypto_idfp); e.crypto_idfp = string_null; } @@ -220,7 +220,7 @@ void sandbox_ObjectRemove(entity e) if(e.message) { strunzone(e.message); e.message = string_null; } if(e.message2) { strunzone(e.message2); e.message2 = string_null; } remove(e); - e = world; + e = NULL; object_count -= 1; } @@ -234,7 +234,7 @@ string sandbox_ObjectPort_Save(entity e, float database) string s; entity head; - for(head = world; (head = find(head, classname, "object")); ) + for(head = NULL; (head = find(head, classname, "object")); ) { // the main object needs to be first in the array [0] with attached objects following float slot, physics, solidity; @@ -308,7 +308,7 @@ entity sandbox_ObjectPort_Load(entity this, string s, float database) { // load object properties, and spawn a new object with them float n, i; - entity e = world, parent = world; + entity e = NULL, parent = NULL; // separate objects between the ; symbols n = tokenizebyseparator(s, "; "); @@ -384,10 +384,10 @@ void sandbox_Database_Save() fputs(file_get, strcat("// sandbox storage \"", autocvar_g_sandbox_storage_name, "\" for map \"", GetMapname(), "\" last updated ", strftime(true, "%d-%m-%Y %H:%M:%S"))); fputs(file_get, strcat(" containing ", ftos(object_count), " objects\n")); - for(head = world; (head = find(head, classname, "object")); ) + for(head = NULL; (head = find(head, classname, "object")); ) { // attached objects are persisted separately, ignore them here - if(head.owner != world) + if(head.owner != NULL) continue; // use a line of text for each object, listing all properties @@ -530,7 +530,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) // ---------------- COMMAND: OBJECT, REMOVE ---------------- case "object_remove": e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { if(autocvar_g_sandbox_info > 0) LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n")); @@ -548,7 +548,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) case "copy": // copies customizable properties of the selected object to the clipboard cvar e = sandbox_ObjectEdit_Get(player, autocvar_g_sandbox_editor_free); // can we copy objects we can't edit? - if(e != world) + if(e != NULL) { s = sandbox_ObjectPort_Save(e, false); s = strreplace("\"", "\\\"", s); @@ -594,7 +594,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) case "get": // select e as the object as meant to be attached e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { player.object_attach = e; print_to(player, "^2SANDBOX - INFO: ^7Object selected for attachment"); @@ -603,7 +603,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) print_to(player, "^1SANDBOX - WARNING: ^7Object could not be selected for attachment. Make sure you are facing an object that you have edit rights over"); return true; case "set": - if(player.object_attach == world) + if(player.object_attach == NULL) { print_to(player, "^1SANDBOX - WARNING: ^7No object selected for attachment. Please select an object to be attached first."); return true; @@ -611,10 +611,10 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) // attaches the previously selected object to e e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { sandbox_ObjectAttach_Set(player.object_attach, e, argv(3)); - player.object_attach = world; // object was attached, no longer keep it scheduled for attachment + player.object_attach = NULL; // object was attached, no longer keep it scheduled for attachment print_to(player, "^2SANDBOX - INFO: ^7Object attached successfully"); if(autocvar_g_sandbox_info > 1) LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n")); @@ -625,7 +625,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) case "remove": // removes e if it was attached e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { sandbox_ObjectAttach_Remove(e); print_to(player, "^2SANDBOX - INFO: ^7Child objects detached successfully"); @@ -647,7 +647,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) } e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { switch(argv(2)) { @@ -737,7 +737,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) return true; } e = sandbox_ObjectEdit_Get(player, true); - if(e != world) + if(e != NULL) { // update the owner's name // Do this before checking if you're already the owner and skipping if such, so we @@ -767,7 +767,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) case "object_info": // prints public information about the object to the player e = sandbox_ObjectEdit_Get(player, false); - if(e != world) + if(e != NULL) { switch(argv(2)) { @@ -785,7 +785,7 @@ MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand) s = ""; entity head; i = 0; - for(head = world; (head = find(head, classname, "object")); ) + for(head = NULL; (head = find(head, classname, "object")); ) { if(head.owner == e) { diff --git a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc index c53e9d1448..b16a6c9acf 100644 --- a/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc +++ b/qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc @@ -25,7 +25,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score) if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && player.cvar_cl_spawn_near_teammate)) return; - spawn_spot.msnt_lookat = world; + spawn_spot.msnt_lookat = NULL; if(!teamplay) return; @@ -79,7 +79,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn) if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death) player.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death; - entity best_mate = world; + entity best_mate = NULL; vector best_spot = '0 0 0'; float pc = 0, best_dist = 0, dist = 0; FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( diff --git a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc index fc3177aa23..67e14403c5 100644 --- a/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc +++ b/qcsrc/common/mutators/mutator/touchexplode/touchexplode.qc @@ -18,7 +18,7 @@ void PlayerTouchExplode(entity p1, entity p2) entity e = spawn(); setorigin(e, org); - RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, world); + RadiusDamage(e, NULL, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, NULL, NULL, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, NULL); remove(e); } diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index d04936a5dd..5fdb7ec428 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -880,7 +880,7 @@ void WaypointSprite_Init() void WaypointSprite_Kill(entity wp) { if (!wp) return; - if (wp.owner) wp.owner.(wp.owned_by_field) = world; + if (wp.owner) wp.owner.(wp.owned_by_field) = NULL; remove(wp); } @@ -895,9 +895,9 @@ void WaypointSprite_Disown(entity wp, float fadetime) if (wp.owner) { if (wp.exteriormodeltoclient == wp.owner) - wp.exteriormodeltoclient = world; - wp.owner.(wp.owned_by_field) = world; - wp.owner = world; + wp.exteriormodeltoclient = NULL; + wp.owner.(wp.owned_by_field) = NULL; + wp.owner = NULL; WaypointSprite_FadeOutIn(wp, fadetime); } @@ -951,7 +951,7 @@ entity WaypointSprite_getviewentity(entity e) if (IS_SPEC(e)) e = e.enemy; /* TODO idea (check this breaks nothing) else if (e.classname == "observer") - e = world; + e = NULL; */ return e; } @@ -1039,7 +1039,7 @@ entity WaypointSprite_SpawnFixed( entity icon // initial icon ) { - return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, true, icon); + return WaypointSprite_Spawn(spr, 0, 0, NULL, ofs, NULL, 0, own, ownfield, true, icon); } entity WaypointSprite_DeployFixed( @@ -1060,7 +1060,7 @@ entity WaypointSprite_DeployFixed( maxdistance = waypointsprite_limitedrange; else maxdistance = 0; - return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, player, waypointsprite_deployed_fixed, false, icon); + return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, NULL, ofs, NULL, t, player, waypointsprite_deployed_fixed, false, icon); } entity WaypointSprite_DeployPersonal( @@ -1070,7 +1070,7 @@ entity WaypointSprite_DeployPersonal( entity icon // initial icon ) { - return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, player, waypointsprite_deployed_personal, false, icon); + return WaypointSprite_Spawn(spr, 0, 0, NULL, ofs, NULL, 0, player, waypointsprite_deployed_personal, false, icon); } entity WaypointSprite_Attach( @@ -1082,7 +1082,7 @@ entity WaypointSprite_Attach( { float t; if (player.waypointsprite_attachedforcarrier) - return world; // can't attach to FC + return NULL; // can't attach to FC if (teamplay) t = player.team; else @@ -1092,7 +1092,7 @@ entity WaypointSprite_Attach( maxdistance = waypointsprite_limitedrange; else maxdistance = 0; - return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', world, t, player, waypointsprite_attached, false, icon); + return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', NULL, t, player, waypointsprite_attached, false, icon); } entity WaypointSprite_AttachCarrier( @@ -1102,7 +1102,7 @@ entity WaypointSprite_AttachCarrier( ) { WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached - entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon); + entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', NULL, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon); if (carrier.health) { WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2); diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 7d093f619e..853280d6e0 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -43,7 +43,7 @@ string Notification_CheckArgs( case NOTIF_ALL: { if (client) { - return "Entity provided when world was required!"; + return "Entity provided when NULL was required!"; } break; } @@ -1086,7 +1086,7 @@ void Local_Notification_sound( #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( ( - "Local_Notification_sound(world, %f, '%s', %f, %f) " + "Local_Notification_sound(NULL, %f, '%s', %f, %f) " "^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', timediff: %f, limit: %f\n" ), soundchannel, diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 8ba86ee5fd..7dcfec3534 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -423,8 +423,8 @@ string BUFF_NAME(int i); ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \ ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \ ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \ - ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(world,netname,s1).descriptor.message) \ - ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(world,netname,s1).descriptor.netname) + ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(NULL,netname,s1).descriptor.message) \ + ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(NULL,netname,s1).descriptor.netname) #define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN { \ if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \ diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 06ccde2a57..eee217200f 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -96,7 +96,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma if(!trace_ent) { //dprint("_Movetype_FlyMove: !trace_ent\n"); - trace_ent = world; + trace_ent = NULL; } this.move_flags |= FL_ONGROUND; diff --git a/qcsrc/common/physics/movetypes/push.qc b/qcsrc/common/physics/movetypes/push.qc index 29ce131064..0d03bfff8f 100644 --- a/qcsrc/common/physics/movetypes/push.qc +++ b/qcsrc/common/physics/movetypes/push.qc @@ -148,7 +148,7 @@ void _Movetype_Physics_Pusher(entity this, float dt) // SV_Physics_Pusher { this.move_nextthink = 0; this.move_time = time; - other = world; + other = NULL; this.move_think(this); } } diff --git a/qcsrc/common/physics/movetypes/toss.qc b/qcsrc/common/physics/movetypes/toss.qc index dbd25c8e3f..f515a75f9f 100644 --- a/qcsrc/common/physics/movetypes/toss.qc +++ b/qcsrc/common/physics/movetypes/toss.qc @@ -14,7 +14,7 @@ void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss } else if (this.move_suspendedinair && wasfreed(this.move_groundentity)) { - this.move_groundentity = world; + this.move_groundentity = NULL; return; } } diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index ec2f7cad3d..7e99bebea7 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -28,7 +28,7 @@ void PlayerStats_GameReport_AddPlayer(entity e) else if(IS_BOT_CLIENT(e)) { s = sprintf("bot#%g#%s", skill, e.cleanname); } - if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then! + if((s == "") || find(NULL, playerstats_id, s)) // already have one of the ID - next one can't be tracked then! { if(IS_BOT_CLIENT(e)) { s = sprintf("bot#%d", e.playerid); } @@ -198,7 +198,7 @@ void PlayerStats_GameReport(float finished) autocvar_g_playerstats_gamereport_uri, FILE_APPEND, PlayerStats_GameReport_Handler, - world + NULL ); } else @@ -635,7 +635,7 @@ void PlayerStats_PlayerDetail() autocvar_g_playerstats_playerdetail_uri, FILE_APPEND, PlayerStats_PlayerDetail_Handler, - world + NULL ); PlayerStats_PlayerDetail_Status = PS_D_STATUS_WAITING; @@ -1013,7 +1013,7 @@ void PlayerInfo_Details() //uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0))); uri = strcat(uri, "/player/me"); print("Retrieving playerstats from URL: ", uri, "\n"); - url_single_fopen(uri, FILE_APPEND, PlayerInfo_ready, world); + url_single_fopen(uri, FILE_APPEND, PlayerInfo_ready, NULL); } } #endif diff --git a/qcsrc/common/sounds/all.qc b/qcsrc/common/sounds/all.qc index 751462498c..9096dddfa8 100644 --- a/qcsrc/common/sounds/all.qc +++ b/qcsrc/common/sounds/all.qc @@ -108,7 +108,7 @@ void stopsound(entity e, int chan) void play2(entity e, string filename) { msg_entity = e; - soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE); + soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE); } .float spamtime; @@ -134,7 +134,7 @@ void play2team(float t, string filename) void play2all(string samp) { if (autocvar_bot_sound_monopoly) return; - _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE); + _sound(NULL, CH_INFO, samp, VOL_BASE, ATTEN_NONE); } #endif diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 03fdba42a8..a0255d7d61 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -529,7 +529,7 @@ void Item_RespawnCountdown (entity this) { entity wi = Weapons_from(this.weapon); if (wi != WEP_Null) { - entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Weapon); + entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Weapon); wp.wp_extra = wi.m_id; break; } @@ -537,7 +537,7 @@ void Item_RespawnCountdown (entity this) { entity ii = this.itemdef; if (ii != NULL) { - entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Item); + entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Item); wp.wp_extra = ii.m_id; break; } @@ -825,7 +825,7 @@ LABEL(pickup) if(this.team) { RandomSelection_Init(); - for(entity head = world; (head = findfloat(head, team, this.team)); ) + for(entity head = NULL; (head = findfloat(head, team, this.team)); ) { if(head.flags & FL_ITEM) if(head.classname != "item_flag_team" && head.classname != "item_key_team") diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index ff3ce35fd1..1a65710a98 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -201,7 +201,7 @@ void func_breakable_destroy(entity this, entity actor, entity trigger) string oldmsg; entity act = this.owner; - this.owner = world; // set by W_PrepareExplosionByDamage + this.owner = NULL; // set by W_PrepareExplosionByDamage // now throw around the debris n = tokenize_console(this.debris); @@ -214,7 +214,7 @@ void func_breakable_destroy(entity this, entity actor, entity trigger) _sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM); if(this.dmg) - RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, world, this.dmg_force, DEATH_HURTTRIGGER.m_id, world); + RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, NULL, this.dmg_force, DEATH_HURTTRIGGER.m_id, NULL); if(this.cnt) // TODO __pointparticles(this.cnt, this.absmin * 0.5 + this.absmax * 0.5, '0 0 0', this.count); diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index b8980a1561..e2335b8831 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -11,8 +11,8 @@ void conveyor_think(entity this) entity e; // set mythis as current conveyor where possible - for(e = world; (e = findentity(e, conveyor, this)); ) - e.conveyor = world; + for(e = NULL; (e = findentity(e, conveyor, this)); ) + e.conveyor = NULL; if(this.state) { @@ -32,7 +32,7 @@ void conveyor_think(entity this) e.conveyor = this; } - for(e = world; (e = findentity(e, conveyor, this)); ) + for(e = NULL; (e = findentity(e, conveyor, this)); ) { if(IS_CLIENT(e)) // doing it via velocity has quite some advantages continue; // done in SV_PlayerPhysics continue; diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 86d7cb2974..f32a8d75de 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -520,7 +520,7 @@ void LinkDoors(entity this) { LOG_TRACE(" ", etos(t)); t.owner = this; - if(t.enemy == world) + if(t.enemy == NULL) { t.enemy = this; break; diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index ece31ac0e9..1705d4081e 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -220,11 +220,11 @@ void Draw_PointParticles(entity this) p.x += random() * sz.x; p.y += random() * sz.y; p.z += random() * sz.z; - if(WarpZoneLib_BoxTouchesBrush(p, p, this, world)) + if(WarpZoneLib_BoxTouchesBrush(p, p, this, NULL)) { if(this.movedir != '0 0 0') { - traceline(p, p + normalize(this.movedir) * 4096, 0, world); + traceline(p, p + normalize(this.movedir) * 4096, 0, NULL); p = trace_endpos; int eff_num; if(this.cnt) diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 015668328a..3f6af7d001 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -6,18 +6,18 @@ void train_use(entity this, entity actor, entity trigger); void train_wait(entity this) { SUB_UseTargets(this.enemy, NULL, NULL); - this.enemy = world; + this.enemy = NULL; // if turning is enabled, the train will turn toward the next point while waiting if(this.platmovetype_turn && !this.train_wait_turning) { entity targ, cp; vector ang; - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); if((this.spawnflags & 1) && targ.curvetarget) - cp = find(world, targetname, targ.curvetarget); + cp = find(NULL, targetname, targ.curvetarget); else - cp = world; + cp = NULL; if(cp) // bezier curves movement ang = cp.origin - (this.origin - this.view_ofs); // use the origin of the control point of the next path_corner @@ -40,7 +40,7 @@ void train_wait(entity this) #endif #ifdef SVQC - entity tg = find(world, targetname, this.target); + entity tg = find(NULL, targetname, this.target); if(tg.spawnflags & 4) { this.use = train_use; @@ -63,16 +63,16 @@ void train_wait(entity this) void train_next(entity this) { - entity targ, cp = world; + entity targ, cp = NULL; vector cp_org = '0 0 0'; - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); this.target = targ.target; if (this.spawnflags & 1) { if(targ.curvetarget) { - cp = find(world, targetname, targ.curvetarget); // get its second target (the control point) + cp = find(NULL, targetname, targ.curvetarget); // get its second target (the control point) cp_org = cp.origin - this.view_ofs; // no control point found, assume a straight line to the destination } } @@ -186,7 +186,7 @@ void train_use(entity this, entity actor, entity trigger) void func_train_find(entity this) { entity targ; - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); this.target = targ.target; if (this.target == "") objerror(this, "func_train_find: no next target"); diff --git a/qcsrc/common/triggers/func/vectormamamam.qc b/qcsrc/common/triggers/func/vectormamamam.qc index 6eb65936b9..accdc99835 100644 --- a/qcsrc/common/triggers/func/vectormamamam.qc +++ b/qcsrc/common/triggers/func/vectormamamam.qc @@ -74,16 +74,16 @@ void func_vectormamamam_controller_think(entity this) void func_vectormamamam_findtarget(entity this) { if(this.target != "") - this.wp00 = find(world, targetname, this.target); + this.wp00 = find(NULL, targetname, this.target); if(this.target2 != "") - this.wp01 = find(world, targetname, this.target2); + this.wp01 = find(NULL, targetname, this.target2); if(this.target3 != "") - this.wp02 = find(world, targetname, this.target3); + this.wp02 = find(NULL, targetname, this.target3); if(this.target4 != "") - this.wp03 = find(world, targetname, this.target4); + this.wp03 = find(NULL, targetname, this.target4); if(!this.wp00 && !this.wp01 && !this.wp02 && !this.wp03) objerror(this, "No reference entity found, so there is nothing to move. Aborting."); diff --git a/qcsrc/common/triggers/misc/follow.qc b/qcsrc/common/triggers/misc/follow.qc index 8949f17a9e..69222bf2d8 100644 --- a/qcsrc/common/triggers/misc/follow.qc +++ b/qcsrc/common/triggers/misc/follow.qc @@ -4,12 +4,12 @@ void follow_init(entity this) { entity src, dst; - src = world; - dst = world; + src = NULL; + dst = NULL; if(this.killtarget != "") - src = find(world, targetname, this.killtarget); + src = find(NULL, targetname, this.killtarget); if(this.target != "") - dst = find(world, targetname, this.target); + dst = find(NULL, targetname, this.target); if(!src && !dst) { diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 15c7e26301..399ba5baf5 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -52,7 +52,7 @@ void misc_laser_aim(entity this) void misc_laser_init(entity this) { if(this.target != "") - this.enemy = find(world, targetname, this.target); + this.enemy = find(NULL, targetname, this.target); } .entity pusher; diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 4ce98b944b..d43cbec769 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -71,7 +71,7 @@ spawnfunc(target_music) } void TargetMusic_RestoreGame() { - for(entity e = world; (e = find(e, classname, "target_music")); ) + for(entity e = NULL; (e = find(e, classname, "target_music")); ) { if(e.targetname == "") target_music_sendto(e, MSG_INIT, 1); @@ -188,7 +188,7 @@ void TargetMusic_Advance() it.lastvol = vol; } }); - music_trigger = world; + music_trigger = NULL; bgmtime = (best) ? getsoundtime(best, CH_BGM_SINGLE) : gettime(GETTIME_CDTRACK); } @@ -254,7 +254,7 @@ void Net_TargetMusic() void Ent_TriggerMusic_Think(entity this) { - if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, this, world)) + if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, this, NULL)) { music_trigger = this; } diff --git a/qcsrc/common/triggers/target/spawn.qc b/qcsrc/common/triggers/target/spawn.qc index 679d66e733..eced856d7e 100644 --- a/qcsrc/common/triggers/target/spawn.qc +++ b/qcsrc/common/triggers/target/spawn.qc @@ -114,7 +114,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti if(time < act.pushltime) valueent = act.pusher; else - valueent = world; + valueent = NULL; value = ""; } else if(value == "target") @@ -144,7 +144,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti } else if(value == "time") { - valueent = world; + valueent = NULL; value = ftos(time); } else @@ -238,10 +238,10 @@ void target_spawn_useon(entity e, entity this, entity actor, entity trigger) this, e, this.message, - find(world, targetname, this.killtarget), - find(world, targetname, this.target2), - find(world, targetname, this.target3), - find(world, targetname, this.target4), + find(NULL, targetname, this.killtarget), + find(NULL, targetname, this.target2), + find(NULL, targetname, this.target3), + find(NULL, targetname, this.target4), actor, trigger ); @@ -257,7 +257,7 @@ bool target_spawn_cancreate(entity this) return true; ++c; // increase count to not include MYSELF - for(e = world; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c) + for(e = NULL; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c) ; // if c now is 0, we have AT LEAST the given count (maybe more), so don't spawn any more @@ -287,7 +287,7 @@ void target_spawn_use(entity this, entity actor, entity trigger) else { // edit entity - for(entity e = world; (e = find(e, targetname, this.target)); ) + for(entity e = NULL; (e = find(e, targetname, this.target)); ) target_spawn_useon(e, this, actor, trigger); } } diff --git a/qcsrc/common/triggers/target/voicescript.qc b/qcsrc/common/triggers/target/voicescript.qc index bfce684c4a..bdf1e0f1fb 100644 --- a/qcsrc/common/triggers/target/voicescript.qc +++ b/qcsrc/common/triggers/target/voicescript.qc @@ -6,7 +6,7 @@ void target_voicescript_clear(entity pl) { - pl.voicescript = world; + pl.voicescript = NULL; } void target_voicescript_use(entity this, entity actor, entity trigger) @@ -67,7 +67,7 @@ void target_voicescript_next(entity pl) } else { - pl.voicescript = world; // stop trying then + pl.voicescript = NULL; // stop trying then } } } diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index 90a426e630..ba472ac557 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -187,7 +187,7 @@ entity Simple_TeleportPlayer(entity teleporter, entity player) else { RandomSelection_Init(); - for(e = world; (e = find(e, targetname, teleporter.target)); ) + for(e = NULL; (e = find(e, targetname, teleporter.target)); ) { p = 1; if(STAT(TELEPORT_TELEFRAG_AVOID, player)) @@ -250,7 +250,7 @@ void teleport_findtarget(entity this) { int n = 0; entity e; - for(e = world; (e = find(e, targetname, this.target)); ) + for(e = NULL; (e = find(e, targetname, this.target)); ) { ++n; #ifdef SVQC @@ -275,7 +275,7 @@ void teleport_findtarget(entity this) else { // have to use random selection every single time - this.enemy = world; + this.enemy = NULL; } // now enable touch @@ -288,10 +288,10 @@ void teleport_findtarget(entity this) entity Teleport_Find(vector mi, vector ma) { entity e; - for(e = world; (e = find(e, classname, "trigger_teleport")); ) - if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world)) + for(e = NULL; (e = find(e, classname, "trigger_teleport")); ) + if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL)) return e; - return world; + return NULL; } void WarpZone_PostTeleportPlayer_Callback(entity pl) @@ -313,7 +313,7 @@ void WarpZone_PostTeleportPlayer_Callback(entity pl) if(!(pl.move_flags & BIT(15))) // FL_PROJECTILE #endif LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n"); - pl.owner = world; + pl.owner = NULL; } if(IS_PLAYER(pl)) { diff --git a/qcsrc/common/triggers/trigger/disablerelay.qc b/qcsrc/common/triggers/trigger/disablerelay.qc index a09e0ba097..1d30db0e08 100644 --- a/qcsrc/common/triggers/trigger/disablerelay.qc +++ b/qcsrc/common/triggers/trigger/disablerelay.qc @@ -3,7 +3,7 @@ void trigger_disablerelay_use(entity this, entity actor, entity trigger) { int a = 0, b = 0; - for(entity e = world; (e = find(e, targetname, this.target)); ) + for(entity e = NULL; (e = find(e, targetname, this.target)); ) { if(e.use == SUB_UseTargets) { diff --git a/qcsrc/common/triggers/trigger/gravity.qc b/qcsrc/common/triggers/trigger/gravity.qc index 4472b572e5..9dcc710f03 100644 --- a/qcsrc/common/triggers/trigger/gravity.qc +++ b/qcsrc/common/triggers/trigger/gravity.qc @@ -10,7 +10,7 @@ void trigger_gravity_remove(entity own) } else backtrace("Removing a trigger_gravity_check with no valid owner"); - own.trigger_gravity_check = world; + own.trigger_gravity_check = NULL; } void trigger_gravity_check_think(entity this) { diff --git a/qcsrc/common/triggers/trigger/hurt.qc b/qcsrc/common/triggers/trigger/hurt.qc index 69653ad3cf..92a4dd0299 100644 --- a/qcsrc/common/triggers/trigger/hurt.qc +++ b/qcsrc/common/triggers/trigger/hurt.qc @@ -4,7 +4,7 @@ void trigger_hurt_use(entity this, entity actor, entity trigger) if(IS_PLAYER(actor)) this.enemy = actor; else - this.enemy = world; // let's just destroy it, if taking over is too much work + this.enemy = NULL; // let's just destroy it, if taking over is too much work } .float triggerhurttime; @@ -31,7 +31,7 @@ void trigger_hurt_touch(entity this) if (!IS_PLAYER(own)) { own = this; - this.enemy = world; // I still hate you all + this.enemy = NULL; // I still hate you all } Damage (other, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0'); diff --git a/qcsrc/common/triggers/trigger/impulse.qc b/qcsrc/common/triggers/trigger/impulse.qc index aee2f72cbe..91381f4877 100644 --- a/qcsrc/common/triggers/trigger/impulse.qc +++ b/qcsrc/common/triggers/trigger/impulse.qc @@ -13,7 +13,7 @@ void trigger_impulse_touch1(entity this) EXACTTRIGGER_TOUCH; - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); if(!targ) { objerror(this, "trigger_force without a (valid) .target!\n"); diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 464d05d089..8100f6b797 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -152,7 +152,7 @@ void trigger_push_touch(entity this) { entity e; RandomSelection_Init(); - for(e = world; (e = find(e, targetname, this.target)); ) + for(e = NULL; (e = find(e, targetname, this.target)); ) { if(e.cnt) RandomSelection_Add(e, 0, string_null, e.cnt, 1); @@ -285,7 +285,7 @@ void trigger_push_findtarget(entity this) if (this.target) { float n = 0; - for(t = world; (t = find(t, targetname, this.target)); ) + for(t = NULL; (t = find(t, targetname, this.target)); ) { ++n; #ifdef SVQC @@ -311,12 +311,12 @@ void trigger_push_findtarget(entity this) else if(n == 1) { // exactly one dest - bots love that - this.enemy = find(world, targetname, this.target); + this.enemy = find(NULL, targetname, this.target); } else { // have to use random selection every single time - this.enemy = world; + this.enemy = NULL; } } #ifdef SVQC diff --git a/qcsrc/common/triggers/trigger/keylock.qc b/qcsrc/common/triggers/trigger/keylock.qc index c8ff29cb7b..1333978768 100644 --- a/qcsrc/common/triggers/trigger/keylock.qc +++ b/qcsrc/common/triggers/trigger/keylock.qc @@ -3,7 +3,7 @@ */ void trigger_keylock_trigger(entity this, entity actor, string s) { - for(entity t = world; (t = find(t, targetname, s)); ) + for(entity t = NULL; (t = find(t, targetname, s)); ) if(t.use) t.use(t, actor, this); } @@ -14,7 +14,7 @@ void trigger_keylock_trigger(entity this, entity actor, string s) void trigger_keylock_kill(string s) { entity t; - for(t = world; (t = find(t, targetname, s)); ) + for(t = NULL; (t = find(t, targetname, s)); ) remove(t); } diff --git a/qcsrc/common/triggers/trigger/relay_activators.qc b/qcsrc/common/triggers/trigger/relay_activators.qc index dabbbd2d96..bbb49d0e5c 100644 --- a/qcsrc/common/triggers/trigger/relay_activators.qc +++ b/qcsrc/common/triggers/trigger/relay_activators.qc @@ -1,7 +1,7 @@ #ifdef SVQC void relay_activators_use(entity this, entity actor, entity trigger) { - for(entity trg = world; (trg = find(trg, targetname, this.target)); ) + for(entity trg = NULL; (trg = find(trg, targetname, this.target)); ) { if (trg.setactive) trg.setactive(trg, this.cnt); diff --git a/qcsrc/common/triggers/trigger/viewloc.qc b/qcsrc/common/triggers/trigger/viewloc.qc index 9e4ab50682..9d675bbc73 100644 --- a/qcsrc/common/triggers/trigger/viewloc.qc +++ b/qcsrc/common/triggers/trigger/viewloc.qc @@ -17,8 +17,8 @@ void viewloc_think(entity this) // we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities // set myself as current viewloc where possible - for(e = world; (e = findentity(e, viewloc, this)); ) - e.viewloc = world; + for(e = NULL; (e = findentity(e, viewloc, this)); ) + e.viewloc = NULL; for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain) if(!e.viewloc) @@ -58,13 +58,13 @@ bool trigger_viewloc_send(entity this, entity to, int sf) void viewloc_init(entity this) { entity e; - for(e = world; (e = find(e, targetname, this.target)); ) + for(e = NULL; (e = find(e, targetname, this.target)); ) if(e.classname == "target_viewlocation_start") { this.enemy = e; break; } - for(e = world; (e = find(e, targetname, this.target2)); ) + for(e = NULL; (e = find(e, targetname, this.target2)); ) if(e.classname == "target_viewlocation_end") { this.goalentity = e; @@ -136,8 +136,8 @@ spawnfunc(target_viewlocation) { spawnfunc_target_viewlocation_start(this); } void trigger_viewloc_updatelink(entity this) { - this.enemy = findfloat(world, entnum, this.cnt); - this.goalentity = findfloat(world, entnum, this.count); + this.enemy = findfloat(NULL, entnum, this.cnt); + this.goalentity = findfloat(NULL, entnum, this.count); } NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew) @@ -145,8 +145,8 @@ NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew) float point1 = ReadShort(); float point2 = ReadShort(); - this.enemy = findfloat(world, entnum, point1); - this.goalentity = findfloat(world, entnum, point2); + this.enemy = findfloat(NULL, entnum, point1); + this.goalentity = findfloat(NULL, entnum, point2); this.origin_x = ReadCoord(); this.origin_y = ReadCoord(); diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 0e13a6bdeb..a9050357f6 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -224,7 +224,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger) s = this.killtarget; if (s != "") { - for(entity t = world; (t = find(t, targetname, s)); ) + for(entity t = NULL; (t = find(t, targetname, s)); ) remove(t); } #endif @@ -251,7 +251,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger) // Flag to set func_clientwall state // 1 == deactivate, 2 == activate, 0 == do nothing int aw_flag = this.antiwall_flag; - for(entity t = world; (t = find(t, targetname, s)); ) + for(entity t = NULL; (t = find(t, targetname, s)); ) { if(t.use) { diff --git a/qcsrc/common/turrets/checkpoint.qc b/qcsrc/common/turrets/checkpoint.qc index d0e07bc3f6..dc48fd1156 100644 --- a/qcsrc/common/turrets/checkpoint.qc +++ b/qcsrc/common/turrets/checkpoint.qc @@ -54,8 +54,8 @@ void turret_checkpoint_init(entity this) if(this.target != "") { - this.enemy = find(world, targetname, this.target); - if(this.enemy == world) + this.enemy = find(NULL, targetname, this.target); + if(this.enemy == NULL) LOG_TRACE("A turret_checkpoint faild to find its target!\n"); } //setthink(this, turret_checkpoint_think); diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 347a5ff838..55719cb3f5 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -2,7 +2,7 @@ void turret_remove(entity this) { remove(this.tur_head); //remove(this.enemy); - this.tur_head = world; + this.tur_head = NULL; } .vector glowmod; @@ -206,7 +206,7 @@ void turret_construct(entity this) { entity tur = get_turretinfo(this.m_id); - if(this.tur_head == world) + if(this.tur_head == NULL) this.tur_head = spawn(); this.netname = tur.turret_name; @@ -282,9 +282,9 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo { entity gib; - traceline(_from, _to, MOVE_NOMONSTERS, world); + traceline(_from, _to, MOVE_NOMONSTERS, NULL); if(trace_startsolid) - return world; + return NULL; gib = new(turret_gib); setorigin(gib, _from); @@ -379,7 +379,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew) if(sf & TNSF_ANG) { - if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. + if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great. this.tur_head = spawn(); this.tur_head.move_angles_x = ReadShort(); @@ -390,7 +390,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew) if(sf & TNSF_AVEL) { - if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great. + if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great. this.tur_head = spawn(); this.tur_head.move_avelocity_x = ReadShort(); diff --git a/qcsrc/common/turrets/config.qc b/qcsrc/common/turrets/config.qc index 022e73c5e3..f5989b48d1 100644 --- a/qcsrc/common/turrets/config.qc +++ b/qcsrc/common/turrets/config.qc @@ -38,7 +38,7 @@ void Dump_Turret_Settings() it.tr_config(it); // step 3: sort queue - heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, world); + heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, NULL); // step 4: write queue TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name)) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 154ae69b78..57bb008fcd 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -186,7 +186,7 @@ void turret_die(entity this) this.health = 0; // Go boom - //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,world,min(this.ammo,50)*5,DEATH_TURRET,world); + //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,NULL,min(this.ammo,50)*5,DEATH_TURRET,NULL); Turret tur = get_turretinfo(this.m_id); if(this.damage_flags & TFL_DMG_DEATH_NORESPAWN) @@ -267,7 +267,7 @@ void turret_respawn(entity this) this.tur_head.avelocity = this.avelocity; this.tur_head.angles = this.idle_aim; this.health = this.max_health; - this.enemy = world; + this.enemy = NULL; this.volly_counter = this.shot_volly; this.ammo = this.ammo_max; @@ -365,7 +365,7 @@ void load_unit_settings(entity ent, bool is_reload) string unitname = ent.netname; string sbase; - if (ent == world) + if (ent == NULL) return; if(!ent.turret_scale_damage) ent.turret_scale_damage = 1; @@ -379,7 +379,7 @@ void load_unit_settings(entity ent, bool is_reload) sbase = strcat(cvar_base,unitname); if (is_reload) { - ent.enemy = world; + ent.enemy = NULL; ent.tur_head.avelocity = '0 0 0'; ent.tur_head.angles = '0 0 0'; @@ -434,11 +434,11 @@ void turret_projectile_explode(entity this) this.event_damage = func_null; #ifdef TURRET_DEBUG float d; - d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world); + d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL); this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d; this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg; #else - RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world); + RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL); #endif remove(this); } @@ -547,7 +547,7 @@ void turret_track(entity this) if(!this.active) target_angle = this.idle_aim - ('1 0 0' * this.aim_maxpitch); - else if (this.enemy == world) + else if (this.enemy == NULL) { if(time > this.lip) target_angle = this.idle_aim + this.angles; @@ -844,13 +844,13 @@ entity turret_select_target(entity this) m_score = this.turret_score_target(this,e_enemy) * this.target_select_samebias; } else - e_enemy = this.enemy = world; + e_enemy = this.enemy = NULL; e = findradius(this.origin, this.target_range); // Nothing to aim at? if (!e) - return world; + return NULL; while (e) { @@ -903,7 +903,7 @@ bool turret_firecheck(entity this) if (this.firecheck_flags & TFL_FIRECHECK_NO) return true; - if (this.enemy == world) + if (this.enemy == NULL) return false; // Ready? @@ -999,7 +999,7 @@ void turret_fire(entity this) this.volly_counter = this.shot_volly; if (this.shoot_flags & TFL_SHOOT_CLEARTARGET) - this.enemy = world; + this.enemy = NULL; if (this.shot_volly > 1) this.attack_finished_single[0] = time + this.shot_volly_refire; @@ -1061,7 +1061,7 @@ void turret_think(entity this) e = e.chain; } - this.enemy = world; + this.enemy = NULL; } else if(this.shoot_flags & TFL_SHOOT_CUSTOM) { @@ -1118,7 +1118,7 @@ void turret_think(entity this) if(this.target_validate_time < time) if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0) { - this.enemy = world; + this.enemy = NULL; this.target_validate_time = time + 0.5; do_target_scan = 1; } @@ -1134,7 +1134,7 @@ void turret_think(entity this) } // No target, just go to idle, do any custom stuff and bail. - if (this.enemy == world) + if (this.enemy == NULL) { // Turn & pitch if(!(this.track_flags & TFL_TRACK_NO)) @@ -1170,7 +1170,7 @@ void turret_think(entity this) /* When .used a turret switch team to activator.team. - If activator is world, the turret go inactive. + If activator is NULL, the turret go inactive. */ void turret_use(entity this, entity actor, entity trigger) { @@ -1250,7 +1250,7 @@ bool turret_initialize(entity this, Turret tur) tur.tr_precache(tur); } - entity e = find(world, classname, "turret_manager"); + entity e = find(NULL, classname, "turret_manager"); if(!e) { e = new(turret_manager); @@ -1354,8 +1354,8 @@ bool turret_initialize(entity this, Turret tur) if(!this.tur_defend) if(this.target != "") { - this.tur_defend = find(world, targetname, this.target); - if (this.tur_defend == world) + this.tur_defend = find(NULL, targetname, this.target); + if (this.tur_defend == NULL) { this.target = ""; LOG_TRACE("Turret has invalid defendpoint!\n"); diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index 2d01c36d56..a72a9f016c 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -41,11 +41,11 @@ void ewheel_move_path(entity this) #ifdef EWHEEL_FANCYPATH // Are we close enougth to a path node to switch to the next? if(vdist(this.origin - this.pathcurrent.origin, <, 64)) - if (this.pathcurrent.path_next == world) + if (this.pathcurrent.path_next == NULL) { // Path endpoint reached pathlib_deletepath(this.pathcurrent.owner); - this.pathcurrent = world; + this.pathcurrent = NULL; if (this.pathgoal) { @@ -59,7 +59,7 @@ void ewheel_move_path(entity this) } } else - this.pathgoal = world; + this.pathgoal = NULL; } else this.pathcurrent = this.pathcurrent.path_next; @@ -187,13 +187,13 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) if(it.movetype == MOVETYPE_WALK) { it.velocity = '0 0 0'; - it.enemy = world; + it.enemy = NULL; setorigin(it, it.pos1); if (it.target != "") { - e = find(world, targetname, it.target); + e = find(NULL, targetname, it.target); if (!e) { LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n"); diff --git a/qcsrc/common/turrets/turret/flac_weapon.qc b/qcsrc/common/turrets/turret/flac_weapon.qc index e02c184522..3037f65d0d 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qc +++ b/qcsrc/common/turrets/turret/flac_weapon.qc @@ -38,16 +38,16 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponen void turret_flac_projectile_think_explode(entity this) { - if(this.enemy != world) + if(this.enemy != NULL) if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 3)) setorigin(this, this.enemy.origin + randomvec() * this.owner.shot_radius); #ifdef TURRET_DEBUG - float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world); + float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL); this.owner.tur_dbg_dmg_t_h = this.owner.tur_dbg_dmg_t_h + d; this.owner.tur_dbg_dmg_t_f = this.owner.tur_dbg_dmg_t_f + this.owner.shot_dmg; #else - RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world); + RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL); #endif remove(this); } diff --git a/qcsrc/common/turrets/turret/fusionreactor.qc b/qcsrc/common/turrets/turret/fusionreactor.qc index bdac1f0293..945b35dd0a 100644 --- a/qcsrc/common/turrets/turret/fusionreactor.qc +++ b/qcsrc/common/turrets/turret/fusionreactor.qc @@ -25,7 +25,7 @@ bool turret_fusionreactor_firecheck(entity this) if (IS_DEAD(this.enemy)) return false; - if (this.enemy == world) + if (this.enemy == NULL) return false; if (this.ammo < this.shot_dmg) diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 0b112f2260..9e737ea6cf 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -55,11 +55,11 @@ void turret_hellion_missile_think(entity this) turret_projectile_explode(this); // Enemy dead? just keep on the current heading then. - if ((this.enemy == world) || (IS_DEAD(this.enemy))) + if ((this.enemy == NULL) || (IS_DEAD(this.enemy))) { // Make sure we dont return to tracking a respawned player - this.enemy = world; + this.enemy = NULL; // Turn model this.angles = vectoangles(this.velocity); diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index 5a4677dcec..dc6f49cab3 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -64,7 +64,7 @@ void turret_hk_missile_think(entity this) // turret_hk_missile_explode(); if (IS_DEAD(this.enemy)) - this.enemy = world; + this.enemy = NULL; // Pick the closest valid target. if (!this.enemy) @@ -116,7 +116,7 @@ void turret_hk_missile_think(entity this) fe = 0; } - if ((fe != 1) || (this.enemy == world) || (edist > 1000)) + if ((fe != 1) || (this.enemy == NULL) || (edist > 1000)) { myspeed = vlen(this.velocity); @@ -226,15 +226,15 @@ void turret_hk_missile_think(entity this) //if(this.atime < time) { if ((fe <= 0.99)||(edist > 1000)) { - te_lightning2(world,this.origin, this.origin + vr * lt_seek); - te_lightning2(world,this.origin, this.origin + vl * lt_seek); - te_lightning2(world,this.origin, this.origin + vu * lt_seek); - te_lightning2(world,this.origin, this.origin + vd * lt_seek); - te_lightning2(world,this.origin, vf); + te_lightning2(NULL,this.origin, this.origin + vr * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vl * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vu * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vd * lt_seek); + te_lightning2(NULL,this.origin, vf); } else { - te_lightning2(world,this.origin, this.enemy.origin); + te_lightning2(NULL,this.origin, this.enemy.origin); } bprint("Speed: ", ftos(rint(myspeed)), "\n"); bprint("Trace to solid: ", ftos(rint(ff * 100)), "%\n"); @@ -248,7 +248,7 @@ void turret_hk_missile_think(entity this) bool hk_is_valid_target(entity this, entity e_target) { - if (e_target == world) + if (e_target == NULL) return false; // If only this was used more.. diff --git a/qcsrc/common/turrets/turret/plasma.qc b/qcsrc/common/turrets/turret/plasma.qc index 2182eb1604..7b71ccfc7f 100644 --- a/qcsrc/common/turrets/turret/plasma.qc +++ b/qcsrc/common/turrets/turret/plasma.qc @@ -35,7 +35,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it)) // teamcolor / hit beam effect vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); - WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v); + WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v); } else { diff --git a/qcsrc/common/turrets/turret/plasma_dual.qc b/qcsrc/common/turrets/turret/plasma_dual.qc index 8dc0df432d..86df15059b 100644 --- a/qcsrc/common/turrets/turret/plasma_dual.qc +++ b/qcsrc/common/turrets/turret/plasma_dual.qc @@ -41,7 +41,7 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it)) // teamcolor / hit beam effect vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); - WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v); + WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v); } else { SUPER(PlasmaTurret).tr_attack(thistur, it); } diff --git a/qcsrc/common/turrets/turret/tesla.qc b/qcsrc/common/turrets/turret/tesla.qc index 7da97e7861..cdc6ba3ceb 100644 --- a/qcsrc/common/turrets/turret/tesla.qc +++ b/qcsrc/common/turrets/turret/tesla.qc @@ -81,7 +81,7 @@ bool turret_tesla_firecheck(entity this) if(this.target_validate_time < time) if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0) { - this.enemy = world; + this.enemy = NULL; this.target_validate_time = time + 0.5; do_target_scan = 1; } diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qc b/qcsrc/common/turrets/turret/tesla_weapon.qc index a2062f5555..e21cd498f7 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qc +++ b/qcsrc/common/turrets/turret/tesla_weapon.qc @@ -38,7 +38,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti d *= 0.75; r *= 0.85; t = toast(actor, t, r, d); - if (t == world) break; + if (t == NULL) break; } @@ -54,7 +54,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti entity toast(entity actor, entity from, float range, float damage) { entity e; - entity etarget = world; + entity etarget = NULL; float d,dd; float r; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index 8d8106a55e..1a5c3f09ab 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -99,7 +99,7 @@ void walker_setnoanim(entity this) } void walker_rocket_explode(entity this) { - RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, world, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, world); + RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, NULL, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, NULL); remove (this); } @@ -155,8 +155,8 @@ void walker_rocket_think(entity this) m_speed = vlen(this.velocity); // Enemy dead? just keep on the current heading then. - if (this.enemy == world || IS_DEAD(this.enemy)) - this.enemy = world; + if (this.enemy == NULL || IS_DEAD(this.enemy)) + this.enemy = NULL; if (this.enemy) { @@ -299,11 +299,11 @@ void walker_move_path(entity this) #ifdef WALKER_FANCYPATHING // Are we close enougth to a path node to switch to the next? if(vdist(this.origin - this.pathcurrent.origin, <, 64)) - if (this.pathcurrent.path_next == world) + if (this.pathcurrent.path_next == NULL) { // Path endpoint reached pathlib_deletepath(this.pathcurrent.owner); - this.pathcurrent = world; + this.pathcurrent = NULL; if (this.pathgoal) { @@ -317,7 +317,7 @@ void walker_move_path(entity this) } } else - this.pathgoal = world; + this.pathgoal = NULL; } else this.pathcurrent = this.pathcurrent.path_next; @@ -347,7 +347,7 @@ METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it)) if (it.spawnflags & TSF_NO_PATHBREAK && it.pathcurrent) walker_move_path(it); - else if (it.enemy == world) + else if (it.enemy == NULL) { if(it.pathcurrent) walker_move_path(it); @@ -599,7 +599,7 @@ METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it)) if (it.target != "") { - e = find(world, targetname, it.target); + e = find(NULL, targetname, it.target); if (!e) { LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n"); diff --git a/qcsrc/common/turrets/util.qc b/qcsrc/common/turrets/util.qc index 5d8ee32b7d..4928262f2f 100644 --- a/qcsrc/common/turrets/util.qc +++ b/qcsrc/common/turrets/util.qc @@ -39,8 +39,8 @@ void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax { tracebox(start, smin, smax, end, false, this); - // if it is world we can't hurt it so stop now - if (trace_ent == world || trace_fraction == 1) + // if it is NULL we can't hurt it so stop now + if (trace_ent == NULL || trace_fraction == 1) break; if (trace_ent.solid == SOLID_BSP) @@ -60,7 +60,7 @@ void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax endpoint = trace_endpos; // find all the entities the railgun hit and restore their solid state - ent = findfloat(world, railgunhit, true); + ent = findfloat(NULL, railgunhit, true); while (ent) { // restore their solid type @@ -69,7 +69,7 @@ void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax } // find all the entities the railgun hit and hurt them - ent = findfloat(world, railgunhit, true); + ent = findfloat(NULL, railgunhit, true); while (ent) { // get the details we need to call the damage function diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index d98e80db85..d04fdecd68 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -489,7 +489,7 @@ void get_mi_min_max(float mode) '0 1 0' * ma.y + '0 0 1' * ma.z, '1 0 0' * ma.x, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_min.x = trace_endpos.x; @@ -498,7 +498,7 @@ void get_mi_min_max(float mode) '1 0 0' * ma.x + '0 0 1' * ma.z, '0 1 0' * ma.y, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_min.y = trace_endpos.y; @@ -507,7 +507,7 @@ void get_mi_min_max(float mode) '1 0 0' * ma.x + '0 1 0' * ma.y, '0 0 1' * ma.z, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_min.z = trace_endpos.z; @@ -516,7 +516,7 @@ void get_mi_min_max(float mode) '0 1 0' * ma.y + '0 0 1' * ma.z, '1 0 0' * mi.x, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_max.x = trace_endpos.x; @@ -525,7 +525,7 @@ void get_mi_min_max(float mode) '1 0 0' * ma.x + '0 0 1' * ma.z, '0 1 0' * mi.y, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_max.y = trace_endpos.y; @@ -534,7 +534,7 @@ void get_mi_min_max(float mode) '1 0 0' * ma.x + '0 1 0' * ma.y, '0 0 1' * mi.z, MOVE_WORLDONLY, - world); + NULL); if(!trace_startsolid) mi_max.z = trace_endpos.z; } @@ -643,7 +643,7 @@ int cvar_settemp_restore() }); #else - entity e = world; + entity e = NULL; while((e = find(e, classname, "saved_cvar_value"))) { if(cvar_type(e.netname)) @@ -1436,7 +1436,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t // start with a 1-element queue queue_start = queue_end = e; - queue_end.(fld) = world; + queue_end.(fld) = NULL; queue_end.FindConnectedComponent_processing = 1; // for each queued item: @@ -1444,7 +1444,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t { // find all neighbors of queue_start entity t; - for(t = world; (t = nxt(t, queue_start, pass)); ) + for(t = NULL; (t = nxt(t, queue_start, pass)); ) { if(t.FindConnectedComponent_processing) continue; @@ -1453,7 +1453,7 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t // it is connected? ADD IT. It will look for neighbors soon too. queue_end.(fld) = t; queue_end = t; - queue_end.(fld) = world; + queue_end.(fld) = NULL; queue_end.FindConnectedComponent_processing = 1; } } diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index bd9130a261..57f5990bb7 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -51,7 +51,7 @@ NET_HANDLE(ENT_CLIENT_AUXILIARYXHAIR, bool isnew) int axh_id = bound(0, ReadByte(), MAX_AXH); entity axh = AuxiliaryXhair[axh_id]; - if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + if(axh == NULL || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) { axh = spawn(); axh.draw2d = func_null; @@ -92,7 +92,7 @@ NET_HANDLE(TE_CSQC_VEHICLESETUP, bool isnew) { entity axh = AuxiliaryXhair[i]; - if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + if(axh != NULL && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) remove(axh); axh = spawn(); @@ -231,7 +231,7 @@ void Vehicles_drawHUD( if(alarm1time < time) { alarm1time = time + 2; - vehicle_alarm(world, CH_PAIN_SINGLE, SND_VEH_ALARM); + vehicle_alarm(NULL, CH_PAIN_SINGLE, SND_VEH_ALARM); } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -239,7 +239,7 @@ void Vehicles_drawHUD( { if(alarm1time) { - vehicle_alarm(world, CH_PAIN_SINGLE, SND_Null); + vehicle_alarm(NULL, CH_PAIN_SINGLE, SND_Null); alarm1time = 0; } drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); @@ -253,7 +253,7 @@ void Vehicles_drawHUD( if(alarm2time < time) { alarm2time = time + 1; - vehicle_alarm(world, CH_TRIGGER_SINGLE, SND_VEH_ALARM_SHIELD); + vehicle_alarm(NULL, CH_TRIGGER_SINGLE, SND_VEH_ALARM_SHIELD); } drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL); } @@ -261,7 +261,7 @@ void Vehicles_drawHUD( { if(alarm2time) { - vehicle_alarm(world, CH_TRIGGER_SINGLE, SND_Null); + vehicle_alarm(NULL, CH_TRIGGER_SINGLE, SND_Null); alarm2time = 0; } drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index b5452ba5a8..a797f84c8d 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -65,7 +65,7 @@ void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id) axh_id = bound(0, axh_id, MAX_AXH); axh = own.(AuxiliaryXhair[axh_id]); - if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + if(axh == NULL || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) { axh = spawn(); axh.cnt = axh_id; @@ -95,7 +95,7 @@ void vehicles_locktarget(entity this, float incr, float decr, float _lock_time) { if(this.lock_target && IS_DEAD(this.lock_target)) { - this.lock_target = world; + this.lock_target = NULL; this.lock_strength = 0; this.lock_time = 0; } @@ -112,22 +112,22 @@ void vehicles_locktarget(entity this, float incr, float decr, float _lock_time) return; } - if(trace_ent != world) + if(trace_ent != NULL) { if(SAME_TEAM(trace_ent, this)) - trace_ent = world; + trace_ent = NULL; if(IS_DEAD(trace_ent)) - trace_ent = world; + trace_ent = NULL; if(!(IS_VEHICLE(trace_ent) || IS_TURRET(trace_ent))) - trace_ent = world; + trace_ent = NULL; if(trace_ent.alpha <= 0.5 && trace_ent.alpha != 0) - trace_ent = world; // invisible + trace_ent = NULL; // invisible } - if(this.lock_target == world && trace_ent != world) + if(this.lock_target == NULL && trace_ent != NULL) this.lock_target = trace_ent; if(this.lock_target && trace_ent == this.lock_target) @@ -146,7 +146,7 @@ void vehicles_locktarget(entity this, float incr, float decr, float _lock_time) // Have a locking target // Trace hit current target - if(trace_ent == this.lock_target && trace_ent != world) + if(trace_ent == this.lock_target && trace_ent != NULL) { this.lock_strength = min(this.lock_strength + incr, 1); if(this.lock_strength == 1) @@ -160,7 +160,7 @@ void vehicles_locktarget(entity this, float incr, float decr, float _lock_time) this.lock_strength = max(this.lock_strength - decr, 0); if(this.lock_strength == 0) - this.lock_target = world; + this.lock_target = NULL; } } @@ -215,7 +215,7 @@ void vehicles_projectile_damage(entity this, entity inflictor, entity attacker, void vehicles_projectile_explode(entity this) { - if(this.owner && other != world) + if(this.owner && other != NULL) { if(other == this.owner.vehicle) return; @@ -227,7 +227,7 @@ void vehicles_projectile_explode(entity this) PROJECTILE_TOUCH(this); this.event_damage = func_null; - RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, world, this.shot_force, this.totalfrags, other); + RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.totalfrags, other); remove (this); } @@ -506,7 +506,7 @@ void vehicles_showwp(entity this) rgb = Team_ColorRGB(ent.team); else rgb = '1 1 1'; - entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, ent, '0 0 64', world, 0, ent, waypointsprite_attached, true, RADARICON_Vehicle); + entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, ent, '0 0 64', NULL, 0, ent, waypointsprite_attached, true, RADARICON_Vehicle); wp.colormod = rgb; if(ent.waypointsprite_attached) { @@ -656,7 +656,7 @@ void vehicles_damage(entity this, entity inflictor, entity attacker, float damag if((this.vehicle_flags & VHF_HASSHIELD) && (this.vehicle_shield > 0)) { - if (wasfreed(this.vehicle_shieldent) || this.vehicle_shieldent == world) + if (wasfreed(this.vehicle_shieldent) || this.vehicle_shieldent == NULL) { this.vehicle_shieldent = spawn(); this.vehicle_shieldent.effects = EF_LOWPRECISION; @@ -745,7 +745,7 @@ void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpa if(_minspeed < wc) { float take = min(_speedfac * wc, _maxpain); - Damage (this, world, world, take, DEATH_FALL.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, take, DEATH_FALL.m_id, this.origin, '0 0 0'); this.play_time = time + 0.25; //dprint("wc: ", ftos(wc), "\n"); @@ -846,7 +846,7 @@ void vehicles_exit(entity vehic, bool eject) player.teleportable = TELEPORT_NORMAL; player.alpha = 1; player.PlayerPhysplug = func_null; - player.vehicle = world; + player.vehicle = NULL; player.view_ofs = STAT(PL_VIEW_OFS, NULL); player.event_damage = PlayerDamage; player.hud = HUD_NORMAL; @@ -865,7 +865,7 @@ void vehicles_exit(entity vehic, bool eject) if(!IS_DEAD(vehic)) vehic.avelocity = '0 0 0'; - vehic.tur_head.nodrawtoclient = world; + vehic.tur_head.nodrawtoclient = NULL; if(!teamplay) vehic.team = 0; @@ -884,7 +884,7 @@ void vehicles_exit(entity vehic, bool eject) vehicles_setreturn(vehic); vehicles_reset_colors(vehic); - vehic.owner = world; + vehic.owner = NULL; CSQCMODEL_AUTOINIT(vehic); @@ -900,7 +900,7 @@ void vehicles_touch(entity this) if(this.owner) { if(!forbidWeaponUse(this.owner)) - if(other != world) + if(other != NULL) if((this.origin_z + this.maxs_z) > (other.origin_z)) if(vehicles_crushable(other)) { @@ -983,7 +983,7 @@ void vehicles_enter(entity pl, entity veh) Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_STEAL_SELF); if (autocvar_g_vehicles_steal_show_waypoint) { - entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', world, veh.team, veh, wps_intruder, true, RADARICON_DANGER); + entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', NULL, veh.team, veh, wps_intruder, true, RADARICON_DANGER); wp.colormod = Team_ColorRGB(pl.team); } } @@ -1102,7 +1102,7 @@ void vehicles_spawn(entity this) // disown & reset this.vehicle_hudmodel.viewmodelforclient = this; - this.owner = world; + this.owner = NULL; settouch(this, vehicles_touch); this.event_damage = vehicles_damage; this.iscreature = true; @@ -1121,7 +1121,7 @@ void vehicles_spawn(entity this) // Reset locking this.lock_strength = 0; - this.lock_target = world; + this.lock_target = NULL; this.misc_bulletcounter = 0; // Return to spawn @@ -1156,7 +1156,7 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop) if(this.targetname && this.targetname != "") { - this.vehicle_controller = find(world, target, this.targetname); + this.vehicle_controller = find(NULL, target, this.targetname); if(!this.vehicle_controller) { bprint("^1WARNING: ^7Vehicle with invalid .targetname\n"); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 62830bd558..401483735c 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -135,7 +135,7 @@ bool bumblebee_gunner_frame(entity this) if(autocvar_g_vehicle_bumblebee_cannon_lock) { if(gun.lock_time < time) - gun.enemy = world; + gun.enemy = NULL; if(trace_ent) if(trace_ent.movetype) @@ -269,8 +269,8 @@ void bumblebee_gunner_exit(entity this, int _exitflag) fixedmakevectors(vehic.angles); - if(player == vehic.gunner1) { vehic.gunner1 = world; } - if(player == vehic.gunner2) { vehic.gunner2 = world; v_right *= -1; } + if(player == vehic.gunner1) { vehic.gunner1 = NULL; } + if(player == vehic.gunner2) { vehic.gunner2 = NULL; v_right *= -1; } vector spot = real_origin(gunner); spot = spot + v_up * 128 + v_forward * 300 + v_right * 150; @@ -286,13 +286,13 @@ void bumblebee_gunner_exit(entity this, int _exitflag) MUTATOR_CALLHOOK(VehicleExit, player, gunner); - player.vehicle = world; + player.vehicle = NULL; } bool bumblebee_gunner_enter(entity this, entity player) { entity vehic = this; - entity gunner = world; + entity gunner = NULL; if(!vehic.gunner1 && !vehic.gunner2 && ((time >= vehic.gun1.phase) + (time >= vehic.gun2.phase)) == 2) { @@ -373,7 +373,7 @@ void bumblebee_touch(entity this) { if(autocvar_g_vehicles_enter) { return; } - if(this.gunner1 != world && this.gunner2 != world) + if(this.gunner1 != NULL && this.gunner2 != NULL) { vehicles_touch(this); return; @@ -505,7 +505,7 @@ bool bumblebee_pilot_frame(entity this) if(autocvar_g_vehicle_bumblebee_healgun_locktime) { if(vehic.tur_head.lock_time < time || IS_DEAD(vehic.tur_head.enemy) || STAT(FROZEN, vehic.tur_head.enemy)) - vehic.tur_head.enemy = world; + vehic.tur_head.enemy = NULL; if(trace_ent) if(trace_ent.movetype) @@ -604,7 +604,7 @@ bool bumblebee_pilot_frame(entity this) if(vehic.gun3.enemy) remove(vehic.gun3.enemy); - vehic.gun3.enemy = world; + vehic.gun3.enemy = NULL; } */ @@ -681,16 +681,16 @@ void bumblebee_exit(entity this, int eject) setorigin(this.owner, spot); antilag_clear(this.owner, CS(this.owner)); - this.owner = world; + this.owner = NULL; } void bumblebee_blowup(entity this) { RadiusDamage(this, this.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage, autocvar_g_vehicle_bumblebee_blowup_edgedamage, - autocvar_g_vehicle_bumblebee_blowup_radius, this, world, + autocvar_g_vehicle_bumblebee_blowup_radius, this, NULL, autocvar_g_vehicle_bumblebee_blowup_forceintensity, - DEATH_VH_BUMB_DEATH.m_id, world); + DEATH_VH_BUMB_DEATH.m_id, NULL); sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); Send_Effect(EFFECT_EXPLOSION_BIG, (this.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1); @@ -876,7 +876,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance)) instance.scale = 1.5; // Raygun beam - if(instance.gun3.enemy == world) + if(instance.gun3.enemy == NULL) { instance.gun3.enemy = spawn(); Net_LinkEntity(instance.gun3.enemy, true, 0, bumble_raygun_send); diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index e85e868a65..254f9bfc4a 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -362,14 +362,14 @@ bool racer_frame(entity this) if(vehic.misc_bulletcounter == 1) { - racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world); + racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL); this.vehicle_ammo2 = 50; } else if(vehic.misc_bulletcounter == 2) { - racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world); + racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL); vehic.lock_strength = 0; - vehic.lock_target = world; + vehic.lock_target = NULL; vehic.misc_bulletcounter = 0; vehic.delay = time + autocvar_g_vehicle_racer_rocket_refire; vehic.lip = time; @@ -474,7 +474,7 @@ void racer_exit(entity this, int eject) setorigin(this.owner , spot); } antilag_clear(this.owner, CS(this.owner)); - this.owner = world; + this.owner = NULL; } void racer_blowup(entity this) @@ -484,9 +484,9 @@ void racer_blowup(entity this) RadiusDamage (this, this.enemy, autocvar_g_vehicle_racer_blowup_coredamage, autocvar_g_vehicle_racer_blowup_edgedamage, - autocvar_g_vehicle_racer_blowup_radius, world, world, + autocvar_g_vehicle_racer_blowup_radius, NULL, NULL, autocvar_g_vehicle_racer_blowup_forceintensity, - DEATH_VH_WAKI_DEATH.m_id, world); + DEATH_VH_WAKI_DEATH.m_id, NULL); this.nextthink = time + autocvar_g_vehicle_racer_respawntime; setthink(this, vehicles_spawn); diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 18dd356df7..28716fc266 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -114,7 +114,7 @@ void raptor_land(entity this) void raptor_exit(entity this, int eject) { vector spot; - this.tur_head.exteriormodeltoclient = world; + this.tur_head.exteriormodeltoclient = NULL; if(!IS_DEAD(this)) { @@ -155,7 +155,7 @@ void raptor_exit(entity this, int eject) } antilag_clear(this.owner, CS(this.owner)); - this.owner = world; + this.owner = NULL; } bool raptor_frame(entity this) @@ -290,7 +290,7 @@ bool raptor_frame(entity this) if(autocvar_g_vehicle_raptor_cannon_locktarget == 2) { if(vehic.gun1.lock_time < time || IS_DEAD(vehic.gun1.enemy) || STAT(FROZEN, vehic.gun1.enemy)) - vehic.gun1.enemy = world; + vehic.gun1.enemy = NULL; if(trace_ent) if(trace_ent.movetype) @@ -341,7 +341,7 @@ bool raptor_frame(entity this) (1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * frametime, autocvar_g_vehicle_raptor_cannon_locked_time); - if(vehic.lock_target != world) + if(vehic.lock_target != NULL) if(autocvar_g_vehicle_raptor_cannon_predicttarget) if(vehic.lock_strength == 1) { @@ -520,7 +520,7 @@ void raptor_blowup(entity this) { this.deadflag = DEAD_DEAD; this.vehicle_exit(this, VHEF_NORMAL); - RadiusDamage (this, this.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH.m_id, world); + RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_RAPT_DEATH.m_id, NULL); this.alpha = -1; this.movetype = MOVETYPE_NONE; diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index 3541b25689..56c3e8c610 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -89,8 +89,8 @@ void raptor_bomblet_boom(entity this) { RadiusDamage (this, this.realowner, autocvar_g_vehicle_raptor_bomblet_damage, autocvar_g_vehicle_raptor_bomblet_edgedamage, - autocvar_g_vehicle_raptor_bomblet_radius, world, world, - autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world); + autocvar_g_vehicle_raptor_bomblet_radius, NULL, NULL, + autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, NULL); remove(this); } diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 63924987e2..d41e81ce61 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -346,7 +346,7 @@ void spiderbot_exit(entity this, int eject) if(e.owner == this.owner) { e.realowner = this.owner; - e.owner = world; + e.owner = NULL; } e = e.chain; } @@ -389,7 +389,7 @@ void spiderbot_exit(entity this, int eject) } antilag_clear(this.owner, CS(this.owner)); - this.owner = world; + this.owner = NULL; } void spiderbot_headfade(entity this) @@ -475,7 +475,7 @@ void spiderbot_blowup(entity this) SUB_SetFade(g1, time, min(this.respawntime, 10)); SUB_SetFade(g2, time, min(this.respawntime, 10)); - RadiusDamage (this, this.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH.m_id, world); + RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, NULL); this.alpha = this.tur_head.alpha = this.gun1.alpha = this.gun2.alpha = -1; this.movetype = MOVETYPE_NONE; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 6476ebbf00..27177019ef 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -142,7 +142,7 @@ vector spiberbot_calcartillery(vector org, vector tgt, float ht) void spiderbot_rocket_do(entity this) {; vector v; - entity rocket = world; + entity rocket = NULL; if (this.wait != -10) { diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index fb510f8564..23b3079222 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -64,13 +64,13 @@ void viewloc_PlayerPhysics(entity this) void viewloc_SetTags(entity this) { if(this.viewloc && wasfreed(this.viewloc)) - this.viewloc = world; + this.viewloc = NULL; if(this.viewloc.entnum != this.tag_networkviewloc) if(this.tag_networkviewloc == 0) - this.viewloc = world; + this.viewloc = NULL; else - this.viewloc = findfloat(world, entnum, this.tag_networkviewloc); + this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc); } vector old_camera_angle = '0 0 0'; diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 65168e13a3..897e2caef2 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -173,7 +173,7 @@ string W_FixWeaponOrder_BuildImpulseList(string o) for (i = WEP_FIRST; i <= WEP_LAST; ++i) W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i; heapsort(WEP_LAST - WEP_FIRST + 1, W_FixWeaponOrder_BuildImpulseList_swap, W_FixWeaponOrder_BuildImpulseList_cmp, - world); + NULL); o = ""; for (i = WEP_FIRST; i <= WEP_LAST; ++i) o = strcat(o, " ", ftos(W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST])); diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index 34031a208b..26a05d10ac 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -35,7 +35,7 @@ void Dump_Weapon_Settings() it.wr_config(it); // step 3: sort queue - heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world); + heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, NULL); // step 4: write queue WEP_CONFIG_WRITETOFILE(sprintf( diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index b7d471f5a3..9262698daa 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -234,7 +234,7 @@ void Arc_Player_SetHeat(entity player) void W_Arc_Bolt_Explode(entity this) { this.event_damage = func_null; - RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), world, world, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other); remove(this); } @@ -371,7 +371,7 @@ void W_Arc_Beam_Think(entity this) } } - if(this == this.owner.arc_beam) { this.owner.arc_beam = world; } + if(this == this.owner.arc_beam) { this.owner.arc_beam = NULL; } entity own = this.owner; Weapon w = WEP_ARC; if(!w.wr_checkammo1(w, own) && !w.wr_checkammo2(w, own)) @@ -965,10 +965,10 @@ void Draw_ArcBeam_callback(vector start, vector hit, vector end) void Reset_ArcBeam() { entity e; - for (e = world; (e = findfloat(e, beam_usevieworigin, 1)); ) { + for (e = NULL; (e = findfloat(e, beam_usevieworigin, 1)); ) { e.beam_initialized = false; } - for (e = world; (e = findfloat(e, beam_usevieworigin, 2)); ) { + for (e = NULL; (e = findfloat(e, beam_usevieworigin, 2)); ) { e.beam_initialized = false; } } @@ -1193,8 +1193,8 @@ void Draw_ArcBeam(entity this) '0 0 0', new_origin, MOVE_NORMAL, - world, - world, + NULL, + NULL, Draw_ArcBeam_callback ); @@ -1260,7 +1260,7 @@ void Draw_ArcBeam(entity this) } // cleanup - Draw_ArcBeam_callback_entity = world; + Draw_ArcBeam_callback_entity = NULL; Draw_ArcBeam_callback_last_thickness = 0; Draw_ArcBeam_callback_last_top = '0 0 0'; Draw_ArcBeam_callback_last_bottom = '0 0 0'; @@ -1279,7 +1279,7 @@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool isnew) if(isnew) { - int gunalign = W_GetGunAlignment(world); + int gunalign = W_GetGunAlignment(NULL); this.beam_shotorigin = arc_shotorigin[gunalign]; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index ca305f7ba7..a4fb13c44e 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -68,8 +68,8 @@ void W_Blaster_Touch(entity this) this.blaster_damage, this.blaster_edgedamage, this.blaster_radius, - world, - world, + NULL, + NULL, this.blaster_force, this.projectiledeathtype, other diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 89a2cea429..eb3e72f8ac 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -76,8 +76,8 @@ void W_Crylink_CheckLinks(entity e) float i; entity p; - if(e == world) - error("W_Crylink_CheckLinks: entity is world"); + if(e == NULL) + error("W_Crylink_CheckLinks: entity is NULL"); if(e.classname != "spike" || wasfreed(e)) error(sprintf("W_Crylink_CheckLinks: entity is not a spike but a %s (freed: %d)", e.classname, wasfreed(e))); @@ -98,7 +98,7 @@ void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next) { W_Crylink_CheckLinks(next); if(me == own.crylink_lastgroup) - own.crylink_lastgroup = ((me == next) ? world : next); + own.crylink_lastgroup = ((me == next) ? NULL : next); prev.queuenext = next; next.queueprev = prev; me.classname = "spike_oktoremove"; @@ -128,11 +128,11 @@ void W_Crylink_LinkExplode(entity e, entity e2) a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1); if(e == e.realowner.crylink_lastgroup) - e.realowner.crylink_lastgroup = world; + e.realowner.crylink_lastgroup = NULL; float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY); - RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other); + RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other); W_Crylink_LinkExplode(e.queuenext, e2); @@ -258,7 +258,7 @@ void W_Crylink_LinkJoinEffect_Think(entity this) WEP_CVAR_BOTH(crylink, isprimary, joinexplode_edgedamage) * n, WEP_CVAR_BOTH(crylink, isprimary, joinexplode_radius) * n, e.realowner, - world, + NULL, WEP_CVAR_BOTH(crylink, isprimary, joinexplode_force) * n, e.projectiledeathtype, other @@ -311,12 +311,12 @@ void W_Crylink_Touch(entity this) if(a) f *= a; - float totaldamage = RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, this.projectiledeathtype, other); + float totaldamage = RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * f, this.projectiledeathtype, other); if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(this, WEP_CVAR_BOTH(crylink, isprimary, radius))))) { if(this == this.realowner.crylink_lastgroup) - this.realowner.crylink_lastgroup = world; + this.realowner.crylink_lastgroup = NULL; W_Crylink_LinkExplode(this.queuenext, this); this.classname = "spike_oktoremove"; remove(this); @@ -331,7 +331,7 @@ void W_Crylink_Touch(entity this) } this.cnt = this.cnt - 1; this.angles = vectoangles(this.velocity); - this.owner = world; + this.owner = NULL; this.projectiledeathtype |= HITTYPE_BOUNCE; // commented out as it causes a little hitch... //if(proj.cnt == 0) @@ -366,7 +366,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor) shots = WEP_CVAR_PRI(crylink, shots); Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); - proj = prevproj = firstproj = world; + proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { proj = new(spike); @@ -474,7 +474,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor) shots = WEP_CVAR_SEC(crylink, shots); Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots); - proj = prevproj = firstproj = world; + proj = prevproj = firstproj = NULL; for(counter = 0; counter < shots; ++counter) { proj = new(spike); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index bc4b609bf2..f2ca426554 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -76,7 +76,7 @@ void W_Devastator_Unregister(entity this) { if(this.realowner && this.realowner.lastrocket == this) { - this.realowner.lastrocket = world; + this.realowner.lastrocket = NULL; // this.realowner.rl_release = 1; } } @@ -101,8 +101,8 @@ void W_Devastator_Explode(entity this) WEP_CVAR(devastator, damage), WEP_CVAR(devastator, edgedamage), WEP_CVAR(devastator, radius), - world, - world, + NULL, + NULL, WEP_CVAR(devastator, force), this.projectiledeathtype, other @@ -164,11 +164,11 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity) WEP_CVAR(devastator, remote_jump_damage), WEP_CVAR(devastator, remote_jump_damage), WEP_CVAR(devastator, remote_jump_radius), - world, + NULL, head, 0, this.projectiledeathtype | HITTYPE_BOUNCE, - world + NULL ); break; } @@ -182,11 +182,11 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity) WEP_CVAR(devastator, remote_damage), WEP_CVAR(devastator, remote_edgedamage), WEP_CVAR(devastator, remote_radius), - (handled_as_rocketjump ? head : world), - world, + (handled_as_rocketjump ? head : NULL), + NULL, WEP_CVAR(devastator, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, - world + NULL ); Weapon thiswep = WEP_DEVASTATOR; @@ -259,7 +259,7 @@ void W_Devastator_Think(entity this) this.nextthink = time; if(time > this.cnt) { - other = world; + other = NULL; this.projectiledeathtype |= HITTYPE_BOUNCE; W_Devastator_Explode(this); return; @@ -412,7 +412,7 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor)) // decide whether to detonate rockets entity missile, targetlist, targ; targetlist = findchainfloat(bot_attack, true); - for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == actor) + for(missile = NULL; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == actor) { targ = targetlist; while(targ) @@ -540,7 +540,7 @@ METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponen { entity rock; bool rockfound = false; - for(rock = world; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == actor) + for(rock = NULL; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == actor) { if(!rock.rl_detonate_later) { diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 07c8aa85e2..09cb77c8bd 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -134,11 +134,11 @@ void W_Electro_ExplodeCombo(entity this) WEP_CVAR(electro, combo_damage), WEP_CVAR(electro, combo_edgedamage), WEP_CVAR(electro, combo_radius), - world, - world, + NULL, + NULL, WEP_CVAR(electro, combo_force), WEP_ELECTRO.m_id | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce - world + NULL ); remove(this); @@ -164,8 +164,8 @@ void W_Electro_Explode(entity this) WEP_CVAR_SEC(electro, damage), WEP_CVAR_SEC(electro, edgedamage), WEP_CVAR_SEC(electro, radius), - world, - world, + NULL, + NULL, WEP_CVAR_SEC(electro, force), this.projectiledeathtype, other @@ -180,8 +180,8 @@ void W_Electro_Explode(entity this) WEP_CVAR_PRI(electro, damage), WEP_CVAR_PRI(electro, edgedamage), WEP_CVAR_PRI(electro, radius), - world, - world, + NULL, + NULL, WEP_CVAR_PRI(electro, force), this.projectiledeathtype, other diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index d9da7edf08..d07324701a 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -75,7 +75,7 @@ void W_Fireball_Explode(entity this) // 1. dist damage d = (this.realowner.health + this.realowner.armorvalue); - RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), NULL, NULL, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other); if(this.realowner.health + this.realowner.armorvalue >= d) if(!this.cnt) { @@ -279,7 +279,7 @@ void W_Fireball_Firemine_Think(entity this) { this.cnt += 1; if(this.cnt == 3) - this.owner = world; + this.owner = NULL; } else this.cnt = 0; diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 433ceefe29..d41ad95b93 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -66,7 +66,7 @@ spawnfunc(weapon_hagar) { weapon_defaultspawnfunc(this, WEP_HAGAR); } void W_Hagar_Explode(entity this) { this.event_damage = func_null; - RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other); remove(this); } @@ -79,7 +79,7 @@ void W_Hagar_Explode_use(entity this, entity actor, entity trigger) void W_Hagar_Explode2(entity this) { this.event_damage = func_null; - RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other); remove(this); } @@ -94,7 +94,7 @@ void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage if(this.health <= 0) return; - float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == this.owner) : true) + float is_linkexplode = ( ((inflictor.owner != NULL) ? (inflictor.owner == this.owner) : true) && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) && (this.projectiledeathtype & HITTYPE_SECONDARY)); @@ -129,7 +129,7 @@ void W_Hagar_Touch2(entity this) this.cnt++; Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1); this.angles = vectoangles(this.velocity); - this.owner = world; + this.owner = NULL; this.projectiledeathtype |= HITTYPE_BOUNCE; } } @@ -242,7 +242,7 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity) up = v_up; shots = actor.hagar_load; - missile = world; + missile = NULL; for(counter = 0; counter < shots; ++counter) { missile = new(missile); diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 6b09f90115..c176e84c67 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -64,7 +64,7 @@ void W_HLAC_Touch(entity this) isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY); - RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, other); remove(this); } diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 877c62bdd0..5963b3bc7d 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -89,9 +89,9 @@ void W_Hook_ExplodeThink(entity this) f = this.dmg_last - dmg_remaining_next; this.dmg_last = dmg_remaining_next; - RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, world, this.dmg_force * f, this.projectiledeathtype, world); + RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, NULL, this.dmg_force * f, this.projectiledeathtype, NULL); this.projectiledeathtype |= HITTYPE_BOUNCE; - //RadiusDamage(this, world, this.dmg * f, this.dmg_edge * f, this.dmg_radius, world, world, this.dmg_force * f, this.projectiledeathtype, world); + //RadiusDamage(this, NULL, this.dmg * f, this.dmg_edge * f, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, NULL); if(dt < this.dmg_duration) this.nextthink = time + 0.05; // soon @@ -367,7 +367,7 @@ void Draw_GrapplingHook(entity this) InterpolateOrigin_Do(this); - int s = W_GetGunAlignment(world); + int s = W_GetGunAlignment(NULL); switch(this.HookType) { @@ -394,7 +394,7 @@ void Draw_GrapplingHook(entity this) b = view_origin + view_forward * this.HookRange; else b = view_origin + view_forward * vlen(this.velocity - this.origin); // honor original length of beam! - WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, world); + WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, NULL); b = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; break; @@ -445,7 +445,7 @@ void Draw_GrapplingHook(entity this) Draw_GrapplingHook_trace_callback_rnd = offset; Draw_GrapplingHook_trace_callback_rgb = rgb; Draw_GrapplingHook_trace_callback_a = intensity; - WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((this.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), world, world, Draw_GrapplingHook_trace_callback); + WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((this.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), NULL, NULL, Draw_GrapplingHook_trace_callback); Draw_GrapplingHook_trace_callback_tex = string_null; atrans = WarpZone_TransformOrigin(WarpZone_trace_transform, a); diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 03c305ca95..331e2dd929 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -82,7 +82,7 @@ void W_MachineGun_MuzzleFlash_Think(entity this) { setthink(this, SUB_Remove); this.nextthink = time; - this.realowner.muzzle_flash = world; + this.realowner.muzzle_flash = NULL; return; } @@ -90,7 +90,7 @@ void W_MachineGun_MuzzleFlash_Think(entity this) void W_MachineGun_MuzzleFlash(entity actor) { - if(actor.muzzle_flash == world) + if(actor.muzzle_flash == NULL) actor.muzzle_flash = spawn(); // muzzle flash for 1st person view diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 14a1c6491c..a406e75098 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -120,7 +120,7 @@ void W_MineLayer_Explode(entity this) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, other); if(PS(this.realowner).m_weapon == WEP_MINE_LAYER) { @@ -146,7 +146,7 @@ void W_MineLayer_DoRemoteExplode(entity this) if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW) this.velocity = this.mine_orientation; // particle fx and decals need .velocity - RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, world); + RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, NULL); if(PS(this.realowner).m_weapon == WEP_MINE_LAYER) { @@ -199,7 +199,7 @@ int W_MineLayer_Count(entity e) { int minecount = 0; entity mine; - for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e) + for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e) minecount += 1; return minecount; @@ -234,7 +234,7 @@ void W_MineLayer_Think(entity this) // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams? if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner)) { - other = world; + other = NULL; this.projectiledeathtype |= HITTYPE_BOUNCE; W_MineLayer_Explode(this); return; @@ -385,7 +385,7 @@ float W_MineLayer_PlacedMines(entity this, float detonate) entity mine; float minfound = 0; - for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this) + for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this) { if(detonate) { @@ -422,7 +422,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor)) teamdamage = 0; enemydamage = 0; targetlist = findchainfloat(bot_attack, true); - entity mine = find(world, classname, "mine"); + entity mine = find(NULL, classname, "mine"); while(mine) { if(mine.realowner != actor) @@ -453,7 +453,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor)) if(teamplay && actor.team) desirabledamage = desirabledamage - teamdamage; - mine = find(world, classname, "mine"); + mine = find(NULL, classname, "mine"); while(mine) { if(mine.realowner != actor) diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 7fdc4a6853..5f56f19db1 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -79,7 +79,7 @@ void W_Mortar_Grenade_Explode(entity this) if(this.movetype == MOVETYPE_NONE) this.velocity = this.oldvelocity; - RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other); remove(this); } @@ -104,7 +104,7 @@ void W_Mortar_Grenade_Explode2(entity this) if(this.movetype == MOVETYPE_NONE) this.velocity = this.oldvelocity; - RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other); remove(this); } @@ -133,7 +133,7 @@ void W_Mortar_Grenade_Think1(entity this) this.nextthink = time; if(time > this.cnt) { - other = world; + other = NULL; this.projectiledeathtype |= HITTYPE_BOUNCE; W_Mortar_Grenade_Explode(this); return; @@ -362,7 +362,7 @@ METHOD(Mortar, wr_think, void(entity thiswep, entity actor, .entity weaponentity { bool nadefound = false; entity nade; - for(nade = world; (nade = find(nade, classname, "grenade")); ) if(nade.realowner == actor) + for(nade = NULL; (nade = find(nade, classname, "grenade")); ) if(nade.realowner == actor) { if(!nade.gl_detonate_later) { diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index a512ad2ca8..3b047dc8c9 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -55,20 +55,20 @@ MUTATOR_HOOKFUNCTION(porto_ticker, SV_StartFrame) { void W_Porto_Success(entity this) { - if(this.realowner == world) + if(this.realowner == NULL) { objerror(this, "Cannot succeed successfully: no owner\n"); return; } - this.realowner.porto_current = world; + this.realowner.porto_current = NULL; remove(this); } string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo); void W_Porto_Fail(entity this, float failhard) { - if(this.realowner == world) + if(this.realowner == NULL) { objerror(this, "Cannot fail successfully: no owner\n"); return; @@ -80,7 +80,7 @@ void W_Porto_Fail(entity this, float failhard) Portal_ClearWithID(this.realowner, this.portal_id); } - this.realowner.porto_current = world; + this.realowner.porto_current = NULL; if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(this.realowner.weapons & WEPSET(PORTO))) { @@ -372,7 +372,7 @@ METHOD(PortoLaunch, wr_setup, void(entity thiswep, entity actor)) } METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor)) { - actor.porto_current = world; + actor.porto_current = NULL; } #endif #ifdef CSQC diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 953a064dae..a39c3958f1 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -97,7 +97,7 @@ spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); } void W_Seeker_Missile_Explode(entity this) { this.event_damage = func_null; - RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other); remove(this); } @@ -130,11 +130,11 @@ void W_Seeker_Missile_Think(entity this) spd + WEP_CVAR(seeker, missile_accel) * frametime ); - if(this.enemy != world) + if(this.enemy != NULL) if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy)) - this.enemy = world; + this.enemy = NULL; - if(this.enemy != world) + if(this.enemy != NULL) { e = this.enemy; eorg = 0.5 * (e.absmin + e.absmax); @@ -193,7 +193,7 @@ void W_Seeker_Missile_Think(entity this) if(IS_DEAD(this.enemy)) { - this.enemy = world; + this.enemy = NULL; this.cnt = time + 1 + (random() * 4); this.nextthink = this.cnt; return; @@ -229,9 +229,9 @@ void W_Seeker_Missile_Animate(entity this) this.frame = this.frame +1; this.nextthink = time + 0.05; - if(this.enemy != world) + if(this.enemy != NULL) if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy)) - this.enemy = world; + this.enemy = NULL; if(this.frame == 5) { @@ -280,7 +280,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m missile.damagedbycontents = true; //missile.think = W_Seeker_Missile_Animate; // csqc projectiles. - if(missile.enemy != world) + if(missile.enemy != NULL) missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY; else missile.projectiledeathtype = WEP_SEEKER.m_id; @@ -308,7 +308,7 @@ void W_Seeker_Flac_Explode(entity this) { this.event_damage = func_null; - RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other); + RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other); remove(this); } @@ -382,19 +382,19 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor) entity W_Seeker_Tagged_Info(entity isowner, entity istarget) { entity tag; - for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) + for(tag = NULL; (tag = find(tag, classname, "tag_tracker")); ) if((tag.realowner == isowner) && (tag.tag_target == istarget)) return tag; - return world; + return NULL; } void W_Seeker_Attack(entity actor) { entity tracker, closest_target; - closest_target = world; - for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor) + closest_target = NULL; + for(tracker = NULL; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor) { if(closest_target) { @@ -407,7 +407,7 @@ void W_Seeker_Attack(entity actor) traceline(actor.origin + actor.view_ofs, closest_target.origin, MOVE_NOMONSTERS, actor); if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target))) - closest_target = world; + closest_target = NULL; W_Seeker_Fire_Missile(WEP_SEEKER, actor, '0 0 0', closest_target); } @@ -513,7 +513,7 @@ void W_Seeker_Tag_Touch(entity this) // check to see if this person is already tagged by me entity tag = W_Seeker_Tagged_Info(this.realowner, other); - if(tag != world) + if(tag != NULL) { if(other.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first WaypointSprite_Kill(other.wps_tag_tracker); @@ -598,7 +598,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor) METHOD(Seeker, wr_aim, void(entity thiswep, entity actor)) { if(WEP_CVAR(seeker, type) == 1) - if(W_Seeker_Tagged_Info(actor, actor.enemy) != world) + if(W_Seeker_Tagged_Info(actor, 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); diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 4e0b20fd9a..786671c31f 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -162,7 +162,7 @@ void W_Shockwave_Melee_Think(entity this) // draw lightning beams for debugging #ifdef DEBUG_SHOCKWAVE - te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5); + te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5); te_customflash(targpos, 40, 2, '1 1 1'); #endif @@ -521,7 +521,7 @@ void W_Shockwave_Attack(entity actor) // figure out the direction of force final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias)); final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force)); - //te_lightning2(world, attack_hitpos, (attack_hitpos + (final_force * 200))); + //te_lightning2(NULL, attack_hitpos, (attack_hitpos + (final_force * 200))); // now multiply the direction by force units final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier); @@ -610,7 +610,7 @@ void W_Shockwave_Attack(entity actor) // figure out the direction of force final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias)); final_force = normalize(center - (nearest_on_line - final_force)); - //te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200))); + //te_lightning2(NULL, nearest_on_line, (attack_hitpos + (final_force * 200))); // now multiply the direction by force units final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier); @@ -666,7 +666,7 @@ void W_Shockwave_Attack(entity actor) )); #endif - shockwave_hit[i-1] = world; + shockwave_hit[i-1] = NULL; shockwave_hit_force[i-1] = '0 0 0'; shockwave_hit_damage[i-1] = 0; } @@ -771,14 +771,14 @@ void Draw_Shockwave(entity this) deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z))); new_min_dist = SW_DISTTOMIN; new_min_end = (this.sw_shotorg + (deviation * new_min_dist)); - //te_lightning2(world, new_min_end, this.sw_shotorg); + //te_lightning2(NULL, new_min_end, this.sw_shotorg); // then calculate spread_to_max effect deviation = angle * spread_to_max; deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z))); new_max_dist = vlen(new_min_end - endpos); new_max_end = (new_min_end + (deviation * new_max_dist)); - //te_lightning2(world, new_end, prev_min_end); + //te_lightning2(NULL, new_end, prev_min_end); if(counter == 0) diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 06c48b115b..34d2e462c7 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -127,7 +127,7 @@ void W_Shotgun_Melee_Think(entity this) WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ANTILAG_LATENCY(this.realowner)); // draw lightning beams for debugging - //te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5); + //te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5); //te_customflash(targpos, 40, 2, '1 1 1'); is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent)); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 2a4814e84f..8b061b72a5 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -124,14 +124,14 @@ void VaporizerBeam_Draw(entity this) Draw_VaporizerBeam_trace_callback_rnd = 0; Draw_VaporizerBeam_trace_callback_rgb = rgb; Draw_VaporizerBeam_trace_callback_a = bound(0, fail, 1); - WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, world, world, Draw_VaporizerBeam_trace_callback); + WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, NULL, NULL, Draw_VaporizerBeam_trace_callback); Draw_VaporizerBeam_trace_callback_tex = string_null; /*if(!MUTATOR_CALLHOOK(Particles_VaporizerBeam, this.vorg1, this.vorg2)) if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/ + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/ } NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew) @@ -154,7 +154,7 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew) if(autocvar_cl_vaporizerbeam_particle) { - WarpZone_TrailParticles(world, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2); + WarpZone_TrailParticles(NULL, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2); this.draw = func_null; this.drawmask = MASK_NORMAL; remove(this); @@ -175,7 +175,7 @@ void W_RocketMinsta_Explosion(entity actor, vector loc) entity dmgent = spawn(); dmgent.owner = dmgent.realowner = actor; setorigin(dmgent, loc); - RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, world, world, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other); + RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, NULL, NULL, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other); remove(dmgent); } @@ -224,7 +224,7 @@ void W_RocketMinsta_Laser_Explode (entity this) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other); + RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, other); remove(this); } @@ -237,7 +237,7 @@ void W_RocketMinsta_Laser_Touch (entity this) { PROJECTILE_TOUCH(this); //W_RocketMinsta_Laser_Explode (); - RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other); + RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, other); remove(this); } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index d523686d63..640cd2c402 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -128,9 +128,9 @@ NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew) if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos)) if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); + WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); return true; } #endif diff --git a/qcsrc/lib/sortlist.qc b/qcsrc/lib/sortlist.qc index 1d8726c898..6748b60cd7 100644 --- a/qcsrc/lib/sortlist.qc +++ b/qcsrc/lib/sortlist.qc @@ -13,7 +13,7 @@ entity Sort_New(float(entity,entity) cmp) entity sort; sort = spawn(); sort.sort_cmp = cmp; - sort.sort_next = world; + sort.sort_next = NULL; sort.chain = sort; return sort; } @@ -56,7 +56,7 @@ void Sort_Reset(entity sort) float Sort_HasNext(entity sort) { - return (sort.chain.sort_next != world); + return (sort.chain.sort_next != NULL); } entity Sort_Next(entity sort) @@ -67,7 +67,7 @@ entity Sort_Next(entity sort) next = spawn(); sort.chain.sort_next = next; next.sort_prev = sort.chain; - next.sort_next = world; + next.sort_next = NULL; } sort.chain = next; return next; diff --git a/qcsrc/lib/stats.qh b/qcsrc/lib/stats.qh index 228e604a28..bd8b792967 100644 --- a/qcsrc/lib/stats.qh +++ b/qcsrc/lib/stats.qh @@ -93,7 +93,7 @@ USING(vectori, vector); #define REGISTER_STAT_3(id, T, expr) \ REGISTER_STAT_2(id, T); \ [[accumulate]] void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \ - STATIC_INIT(worldstat_##id) { entity this = world; STAT(id, this) = (expr); } + STATIC_INIT(worldstat_##id) { entity this = NULL; STAT(id, this) = (expr); } #else #define REGISTER_STAT_2(id, type) #define REGISTER_STAT_3(id, T, expr) diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 6473e65b1d..5acacc7734 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -54,7 +54,7 @@ vector WarpZone_camera_transform(entity this, vector org, vector ang) vr = WarpZone_TransformVelocity(this, vr); vu = WarpZone_TransformVelocity(this, vu); if(autocvar_cl_warpzone_usetrace) - traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, world); + traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, NULL); else trace_endpos = this.warpzone_targetorigin; v_forward = vf; @@ -156,11 +156,11 @@ entity WarpZone_Find(vector mi, vector ma) // if we are near any warpzone planes - MOVE AWAY (work around nearclip) entity e; if(!warpzone_warpzones_exist) - return world; - for(e = world; (e = find(e, classname, "trigger_warpzone")); ) - if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world)) + return NULL; + for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) + if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL)) return e; - return world; + return NULL; } void WarpZone_MakeAllSolid() @@ -168,7 +168,7 @@ void WarpZone_MakeAllSolid() entity e; if(!warpzone_warpzones_exist) return; - for(e = world; (e = find(e, classname, "trigger_warpzone")); ) + for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) e.solid = SOLID_BSP; } @@ -177,7 +177,7 @@ void WarpZone_MakeAllOther() entity e; if(!warpzone_warpzones_exist) return; - for(e = world; (e = find(e, classname, "trigger_warpzone")); ) + for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) e.solid = SOLID_TRIGGER; } @@ -204,8 +204,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, vector vf, vr, vu; WarpZone_trace_forent = forent; - WarpZone_trace_firstzone = world; - WarpZone_trace_lastzone = world; + WarpZone_trace_firstzone = NULL; + WarpZone_trace_lastzone = NULL; WarpZone_Trace_InitTransform(); if(!warpzone_warpzones_exist) { @@ -272,7 +272,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, if(--i < 1) { LOG_TRACE("Too many warpzones in sequence, aborting trace.\n"); - trace_ent = world; + trace_ent = NULL; break; } tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent); @@ -300,7 +300,7 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, { // FIXME can this check be removed? Do we really need it? LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n"); - trace_ent = world; + trace_ent = NULL; break; } wz = trace_ent; @@ -330,7 +330,7 @@ LABEL(fail) void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent) { - WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, world, WarpZone_trace_callback_t_null); + WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, NULL, WarpZone_trace_callback_t_null); } void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent) @@ -349,8 +349,8 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo g = cvar("sv_gravity") * e.gravity; WarpZone_trace_forent = forent; - WarpZone_trace_firstzone = world; - WarpZone_trace_lastzone = world; + WarpZone_trace_firstzone = NULL; + WarpZone_trace_lastzone = NULL; WarpZone_Trace_InitTransform(); WarpZone_tracetoss_time = 0; if(!warpzone_warpzones_exist) @@ -396,7 +396,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo if(--i < 1) { LOG_TRACE("Too many warpzones in sequence, aborting trace.\n"); - trace_ent = world; + trace_ent = NULL; break; } tracetoss(e, WarpZone_trace_forent); @@ -414,7 +414,7 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo { // FIXME can this check be removed? Do we really need it? LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n"); - trace_ent = world; + trace_ent = NULL; break; } wz = trace_ent; @@ -449,7 +449,7 @@ LABEL(fail) void WarpZone_TraceToss(entity e, entity forent) { - WarpZone_TraceToss_ThroughZone(e, forent, world, WarpZone_trace_callback_t_null); + WarpZone_TraceToss_ThroughZone(e, forent, NULL, WarpZone_trace_callback_t_null); } entity WarpZone_TrailParticles_trace_callback_own; @@ -463,7 +463,7 @@ void WarpZone_TrailParticles(entity own, float eff, vector org, vector end) { WarpZone_TrailParticles_trace_callback_own = own; WarpZone_TrailParticles_trace_callback_eff = eff; - WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_trace_callback); + WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_trace_callback); } #ifdef CSQC @@ -480,7 +480,7 @@ void WarpZone_TrailParticles_WithMultiplier(entity own, float eff, vector org, v WarpZone_TrailParticles_trace_callback_eff = eff; WarpZone_TrailParticles_trace_callback_f = f; WarpZone_TrailParticles_trace_callback_flags = boxflags | PARTICLES_DRAWASTRAIL; - WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_WithMultiplier_trace_callback); + WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_WithMultiplier_trace_callback); } #endif @@ -689,7 +689,7 @@ void WarpZone_RefSys_Clear(entity me) if(me.WarpZone_refsys) { remove(me.WarpZone_refsys); - me.WarpZone_refsys = world; + me.WarpZone_refsys = NULL; } } void WarpZone_RefSys_AddTransform(entity me, vector t, vector s) diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 39e20d91ce..7ddb96cbbf 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -111,7 +111,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1) { entity own; own = player.owner; - player.owner = world; + player.owner = NULL; tracebox(trace_endpos, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f1, MOVE_NORMAL, player); // this should get us through the warpzone player.owner = own; } @@ -509,8 +509,8 @@ void WarpZone_InitStep_FindOriginTarget(entity this) { if(this.killtarget != "") { - this.aiment = find(world, targetname, this.killtarget); - if(this.aiment == world) + this.aiment = find(NULL, targetname, this.killtarget); + if(this.aiment == NULL) { error("Warp zone with nonexisting killtarget"); return; @@ -526,8 +526,8 @@ void WarpZonePosition_InitStep_FindTarget(entity this) error("Warp zone position with no target"); return; } - this.enemy = find(world, targetname, this.target); - if(this.enemy == world) + this.enemy = find(NULL, targetname, this.target); + if(this.enemy == NULL) { error("Warp zone position with nonexisting target"); return; @@ -566,11 +566,11 @@ void WarpZoneCamera_InitStep_FindTarget(entity this) error("Camera with no target"); return; } - this.enemy = world; - for(e = world, i = 0; (e = find(e, targetname, this.target)); ) + this.enemy = NULL; + for(e = NULL, i = 0; (e = find(e, targetname, this.target)); ) if(random() * ++i < 1) this.enemy = e; - if(this.enemy == world) + if(this.enemy == NULL) { error("Camera with nonexisting target"); return; @@ -671,8 +671,8 @@ void WarpZone_InitStep_UpdateTransform(entity this) void WarpZone_InitStep_ClearTarget(entity this) { if(this.enemy) - this.enemy.enemy = world; - this.enemy = world; + this.enemy.enemy = NULL; + this.enemy = NULL; } entity warpzone_first; .entity warpzone_next; @@ -689,15 +689,15 @@ void WarpZone_InitStep_FindTarget(entity this) { this.enemy = this; // so the if(!e.enemy) check also skips this, saves one IF - e2 = world; - for(e = world, i = 0; (e = find(e, targetname, this.target)); ) + e2 = NULL; + for(e = NULL, i = 0; (e = find(e, targetname, this.target)); ) if(!e.enemy) if(e.classname == this.classname) // possibly non-warpzones may use the same targetname! if(random() * ++i < 1) e2 = e; if(!e2) { - this.enemy = world; + this.enemy = NULL; error("Warpzone with non-existing target"); return; } diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index bbb1c86342..b2fca55e86 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -151,7 +151,7 @@ void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, { if(this.flags & FL_INWATER) { - this.bot_aimtarg = world; + this.bot_aimtarg = NULL; return; } this.bot_aimtarg = e1; @@ -183,7 +183,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation) // get the desired angles to aim at //dprint(" at:", vtos(v)); v = normalize(v); - //te_lightning2(world, this.origin + this.view_ofs, this.origin + this.view_ofs + v * 200); + //te_lightning2(NULL, this.origin + this.view_ofs, this.origin + this.view_ofs + v * 200); if (time >= this.bot_badaimtime) { this.bot_badaimtime = max(this.bot_badaimtime + 0.3, time); @@ -292,7 +292,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation) shotdir = v_forward; //dprint(" dir:", vtos(v_forward)); - //te_lightning2(world, shotorg, shotorg + shotdir * 100); + //te_lightning2(NULL, shotorg, shotorg + shotdir * 100); // calculate turn angles again //diffang = desiredang - this.v_angle; @@ -308,7 +308,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation) if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180))) if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1)) this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5); - //traceline(shotorg,shotorg+shotdir*1000,false,world); + //traceline(shotorg,shotorg+shotdir*1000,false,NULL); //dprint(ftos(maxfiredeviation),"\n"); //dprint(" diff:", vtos(diffang), "\n"); diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index cde59c6de1..f9afb39d8a 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -80,7 +80,7 @@ void bot_think(entity this) this.dmg_take = 0; this.dmg_save = 0; - this.dmg_inflictor = world; + this.dmg_inflictor = NULL; // calculate an aiming latency based on the skill setting // (simulated network latency + naturally delayed reflexes) @@ -173,7 +173,7 @@ void bot_setnameandstuff(entity this) break; } )); - RandomSelection_Add(world, 0, readfile, 1, prio); + RandomSelection_Add(NULL, 0, readfile, 1, prio); } readfile = RandomSelection_chosen_string; fclose(file); @@ -250,7 +250,7 @@ void bot_setnameandstuff(entity this) this.playermodel = this.playermodel_freeme = strzone(strcat("models/player/", bot_model)); this.playerskin = this.playerskin_freeme = strzone(bot_skin); - this.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the world + this.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the NULL this.cvar_cl_accuracy_data_receive = 0; // don't receive any weapon accuracy data } @@ -351,8 +351,8 @@ void bot_relinkplayerlist() player_count = 0; currentbots = 0; player_list = e = findchainflags(flags, FL_CLIENT); - bot_list = world; - prevbot = world; + bot_list = NULL; + prevbot = NULL; while (e) { player_count = player_count + 1; @@ -364,7 +364,7 @@ void bot_relinkplayerlist() else { bot_list = e; - bot_list.nextbot = world; + bot_list.nextbot = NULL; } prevbot = e; currentbots = currentbots + 1; @@ -396,7 +396,7 @@ void bot_clientdisconnect(entity this) if(this.bot_cmd_current) remove(this.bot_cmd_current); if(bot_waypoint_queue_owner==this) - bot_waypoint_queue_owner = world; + bot_waypoint_queue_owner = NULL; } void bot_clientconnect(entity this) @@ -429,8 +429,8 @@ void bot_removefromlargestteam() { float besttime, bestcount, thiscount; entity best, head; - CheckAllowedTeams(world); - GetTeamCounts(world); + CheckAllowedTeams(NULL); + GetTeamCounts(NULL); head = findchainfloat(isbot, true); if (!head) return; @@ -601,7 +601,7 @@ float bot_fixcount() //dprint(ftos(bots), " ? ", ftos(currentbots), "\n"); while (currentbots < bots) { - if (bot_spawn() == world) + if (bot_spawn() == NULL) { bprint("Can not add bot, server full.\n"); return false; diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index ca95e9ebfe..f6c0348d28 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -41,14 +41,14 @@ void havocbot_ai(entity this) // TODO: tracewalk() should take care of this job (better path finding under water) // if we don't have a goal and we're under water look for a waypoint near the "shore" and push it if(IS_DEAD(this)) - if(this.goalcurrent==world) + if(this.goalcurrent==NULL) if(this.waterlevel==WATERLEVEL_SWIMMING || (this.aistatus & AI_STATUS_OUT_WATER)) { // Look for the closest waypoint out of water entity newgoal, head; float bestdistance, distance; - newgoal = world; + newgoal = NULL; bestdistance = 10000; for (head = findchain(classname, "waypoint"); head; head = head.chain) { @@ -137,7 +137,7 @@ void havocbot_ai(entity this) //heading = this.velocity; //dprint(this.goalstack01.classname,etos(this.goalstack01),"\n"); if( - this.goalstack01 != this && this.goalstack01 != world && ((this.aistatus & AI_STATUS_RUNNING) == 0) && + this.goalstack01 != this && this.goalstack01 != NULL && ((this.aistatus & AI_STATUS_RUNNING) == 0) && !(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT) ) next = ((this.goalstack01.absmin + this.goalstack01.absmax) * 0.5) - (this.origin + this.view_ofs); @@ -155,7 +155,7 @@ void havocbot_ai(entity this) if (this.waterlevel < WATERLEVEL_SWIMMING) v.z = 0; //dprint("walk at:", vtos(v), "\n"); - //te_lightning2(world, this.origin, this.goalcurrent.origin); + //te_lightning2(NULL, this.origin, this.goalcurrent.origin); bot_aimdir(this, v, -1); } havocbot_movetogoal(this); @@ -328,7 +328,7 @@ void havocbot_bunnyhop(entity this, vector dir) if(this.goalcurrent.classname=="waypoint") if (!(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL)) if(fabs(gco.z - this.origin.z) < this.maxs.z - this.mins.z) - if(this.goalstack01!=world) + if(this.goalstack01!=NULL) { gno = (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5; deviation = vectoangles(gno - this.origin) - vectoangles(gco - this.origin); @@ -464,7 +464,7 @@ void havocbot_movetogoal(entity this) return; } // Switch to normal mode - this.navigation_jetpack_goal = world; + this.navigation_jetpack_goal = NULL; this.aistatus &= ~AI_STATUS_JETPACK_LANDING; this.aistatus &= ~AI_STATUS_JETPACK_FLYING; return; @@ -496,7 +496,7 @@ void havocbot_movetogoal(entity this) { if(fabs(this.velocity.z)<50) { - entity head, newgoal = world; + entity head, newgoal = NULL; float distance, bestdistance = 0; for (head = findchain(classname, "waypoint"); head; head = head.chain) @@ -506,7 +506,7 @@ void havocbot_movetogoal(entity this) if(distance>1000) continue; - traceline(this.origin + this.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), true, world); + traceline(this.origin + this.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), true, NULL); if(trace_fraction<1) continue; @@ -574,7 +574,7 @@ void havocbot_movetogoal(entity this) // If there is no goal try to move forward - if(this.goalcurrent==world) + if(this.goalcurrent==NULL) dir = v_forward; else dir = normalize(( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ) - this.origin); @@ -626,14 +626,14 @@ void havocbot_movetogoal(entity this) else { // If there is no goal try to move forward - if(this.goalcurrent==world) + if(this.goalcurrent==NULL) this.movement_x = maxspeed; } } // If we are under water with no goals, swim up if(this.waterlevel) - if(this.goalcurrent==world) + if(this.goalcurrent==NULL) { dir = '0 0 0'; if(this.waterlevel>WATERLEVEL_SWIMMING) @@ -649,14 +649,14 @@ void havocbot_movetogoal(entity this) } // if there is nowhere to go, exit - if (this.goalcurrent == world) + if (this.goalcurrent == NULL) return; if (this.goalcurrent) navigation_poptouchedgoals(this); // if ran out of goals try to use an alternative goal or get a new strategy asap - if(this.goalcurrent == world) + if(this.goalcurrent == NULL) { this.bot_strategytime = 0; return; @@ -734,7 +734,7 @@ void havocbot_movetogoal(entity this) dst_down = dst_ahead - '0 0 1500'; // Look ahead - traceline(this.origin + this.view_ofs, dst_ahead, true, world); + traceline(this.origin + this.view_ofs, dst_ahead, true, NULL); // Check head-banging against walls if(vdist(this.origin + this.view_ofs - trace_endpos, <, 25) && !(this.aistatus & AI_STATUS_OUT_WATER)) @@ -756,9 +756,9 @@ void havocbot_movetogoal(entity this) { this.facingwalltime = 0; - if(this.ignoregoal != world && time > this.ignoregoaltime) + if(this.ignoregoal != NULL && time > this.ignoregoaltime) { - this.ignoregoal = world; + this.ignoregoal = NULL; this.ignoregoaltime = 0; } } @@ -771,9 +771,9 @@ void havocbot_movetogoal(entity this) if((IS_ONGROUND(this)) || (this.aistatus & AI_STATUS_RUNNING) || PHYS_INPUT_BUTTON_JUMP(this)) { // Look downwards - traceline(dst_ahead , dst_down, true, world); - // te_lightning2(world, this.origin, dst_ahead); // Draw "ahead" look - // te_lightning2(world, dst_ahead, dst_down); // Draw "downwards" look + traceline(dst_ahead , dst_down, true, NULL); + // te_lightning2(NULL, this.origin, dst_ahead); // Draw "ahead" look + // te_lightning2(NULL, dst_ahead, dst_down); // Draw "downwards" look if(trace_endpos.z < this.origin.z + this.mins.z) { s = pointcontents(trace_endpos + '0 0 1'); @@ -810,7 +810,7 @@ void havocbot_movetogoal(entity this) dodge = havocbot_dodge(this); dodge = dodge * bound(0,0.5+(skill+this.bot_dodgeskill)*0.1,1); evadelava = evadelava * bound(1,3-(skill+this.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it - traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, world); + traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, NULL); if(IS_PLAYER(trace_ent)) dir = dir * bound(0,(skill+this.bot_dodgeskill)/7,1); @@ -862,7 +862,7 @@ void havocbot_chooseenemy(entity this) vector eye, v; if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(this)) { - this.enemy = world; + this.enemy = NULL; return; } if (this.enemy) @@ -870,7 +870,7 @@ void havocbot_chooseenemy(entity this) if (!bot_shouldattack(this, this.enemy)) { // enemy died or something, find a new target - this.enemy = world; + this.enemy = NULL; this.havocbot_chooseenemy_finished = time; } else if (this.havocbot_stickenemy) @@ -880,7 +880,7 @@ void havocbot_chooseenemy(entity this) // and not really really far away // and we're not severely injured // then keep tracking for a half second into the future - traceline(this.origin+this.view_ofs, ( this.enemy.absmin + this.enemy.absmax ) * 0.5,false,world); + traceline(this.origin+this.view_ofs, ( this.enemy.absmin + this.enemy.absmax ) * 0.5,false,NULL); if (trace_ent == this.enemy || trace_fraction == 1) if (vdist(((this.enemy.absmin + this.enemy.absmax) * 0.5) - this.origin, <, 1000)) if (this.health > 30) @@ -899,7 +899,7 @@ void havocbot_chooseenemy(entity this) return; this.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval; eye = this.origin + this.view_ofs; - best = world; + best = NULL; bestrating = 100000000; head = head2 = findchainfloat(bot_attack, true); @@ -1015,7 +1015,7 @@ void havocbot_chooseweapon(entity this) } // TODO: clean this up by moving it to weapon code - if(this.enemy==world) + if(this.enemy==NULL) { // If no weapon was chosen get the first available weapon if(PS(this).m_weapon==WEP_Null) @@ -1123,7 +1123,7 @@ void havocbot_aim(entity this) lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel); } else - lag_additem(this, time + this.ping, 0, 0, world, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0'); + lag_additem(this, time + this.ping, 0, 0, NULL, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0'); } bool havocbot_moveto_refresh_route(entity this) @@ -1144,7 +1144,7 @@ float havocbot_moveto(entity this, vector pos) if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING) { // Step 4: Move to waypoint - if(this.havocbot_personal_waypoint==world) + if(this.havocbot_personal_waypoint==NULL) { LOG_TRACE("Error: ", this.netname, " trying to walk to a non existent personal waypoint\n"); this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING; @@ -1222,7 +1222,7 @@ float havocbot_moveto(entity this, vector pos) // Step 1: Spawning waypoint wp = waypoint_spawnpersonal(this, pos); - if(wp==world) + if(wp==NULL) { LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos),"\n"); return CMD_STATUS_ERROR; @@ -1234,9 +1234,9 @@ float havocbot_moveto(entity this, vector pos) // if pos is inside a teleport, then let's mark it as teleport waypoint entity head; - for(head = world; (head = find(head, classname, "trigger_teleport")); ) + for(head = NULL; (head = find(head, classname, "trigger_teleport")); ) { - if(WarpZoneLib_BoxTouchesBrush(pos, pos, head, world)) + if(WarpZoneLib_BoxTouchesBrush(pos, pos, head, NULL)) { wp.wpflags |= WAYPOINTFLAG_TELEPORT; this.lastteleporttime = 0; diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc index 2a354d9a57..034e29fabf 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -35,7 +35,7 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float // Check if the item can be picked up safely if(head.classname == "droppedweapon") { - traceline(o, o + '0 0 -1500', true, world); + traceline(o, o + '0 0 -1500', true, NULL); d = pointcontents(trace_endpos + '0 0 1'); if(d & CONTENT_WATER || d & CONTENT_SLIME || d & CONTENT_LAVA) @@ -178,7 +178,7 @@ void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org // not falling if((IS_ONGROUND(it)) == 0) { - traceline(it.origin, it.origin + '0 0 -1500', true, world); + traceline(it.origin, it.origin + '0 0 -1500', true, NULL); t = pointcontents(trace_endpos + '0 0 1'); if(t != CONTENT_SOLID ) if(t & CONTENT_WATER || t & CONTENT_SLIME || t & CONTENT_LAVA) diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 6eb872bb16..8deefdb397 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -229,38 +229,38 @@ void navigation_clearroute(entity this) { //print("bot ", etos(this), " clear\n"); this.navigation_hasgoals = false; - this.goalcurrent = world; - this.goalstack01 = world; - this.goalstack02 = world; - this.goalstack03 = world; - this.goalstack04 = world; - this.goalstack05 = world; - this.goalstack06 = world; - this.goalstack07 = world; - this.goalstack08 = world; - this.goalstack09 = world; - this.goalstack10 = world; - this.goalstack11 = world; - this.goalstack12 = world; - this.goalstack13 = world; - this.goalstack14 = world; - this.goalstack15 = world; - this.goalstack16 = world; - this.goalstack17 = world; - this.goalstack18 = world; - this.goalstack19 = world; - this.goalstack20 = world; - this.goalstack21 = world; - this.goalstack22 = world; - this.goalstack23 = world; - this.goalstack24 = world; - this.goalstack25 = world; - this.goalstack26 = world; - this.goalstack27 = world; - this.goalstack28 = world; - this.goalstack29 = world; - this.goalstack30 = world; - this.goalstack31 = world; + this.goalcurrent = NULL; + this.goalstack01 = NULL; + this.goalstack02 = NULL; + this.goalstack03 = NULL; + this.goalstack04 = NULL; + this.goalstack05 = NULL; + this.goalstack06 = NULL; + this.goalstack07 = NULL; + this.goalstack08 = NULL; + this.goalstack09 = NULL; + this.goalstack10 = NULL; + this.goalstack11 = NULL; + this.goalstack12 = NULL; + this.goalstack13 = NULL; + this.goalstack14 = NULL; + this.goalstack15 = NULL; + this.goalstack16 = NULL; + this.goalstack17 = NULL; + this.goalstack18 = NULL; + this.goalstack19 = NULL; + this.goalstack20 = NULL; + this.goalstack21 = NULL; + this.goalstack22 = NULL; + this.goalstack23 = NULL; + this.goalstack24 = NULL; + this.goalstack25 = NULL; + this.goalstack26 = NULL; + this.goalstack27 = NULL; + this.goalstack28 = NULL; + this.goalstack29 = NULL; + this.goalstack30 = NULL; + this.goalstack31 = NULL; } // add a new goal at the beginning of the stack @@ -343,7 +343,7 @@ void navigation_poproute(entity this) this.goalstack28 = this.goalstack29; this.goalstack29 = this.goalstack30; this.goalstack30 = this.goalstack31; - this.goalstack31 = world; + this.goalstack31 = NULL; } float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist) @@ -399,7 +399,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom if (navigation_testtracewalk) te_plasmaburn(org); - best = world; + best = NULL; // box check failed, try walk w = waylist; @@ -431,7 +431,7 @@ entity navigation_findnearestwaypoint_withdist_except(entity ent, float walkfrom } entity navigation_findnearestwaypoint(entity ent, float walkfromwp) { - entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, world); + entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, NULL); if (autocvar_g_waypointeditor_auto) { entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp); @@ -475,7 +475,7 @@ float navigation_markroutes_nearestwaypoints(entity this, entity waylist, float head.wpnearestpoint = v; head.wpcost = vlen(v - this.origin) + head.dmg; head.wpfire = 1; - head.enemy = world; + head.enemy = NULL; c = c + 1; } } @@ -525,7 +525,7 @@ void navigation_markroutes(entity this, entity fixed_source_waypoint) w.wpnearestpoint = '0 0 0'; w.wpcost = 10000000; w.wpfire = 0; - w.enemy = world; + w.enemy = NULL; w = w.chain; } @@ -535,7 +535,7 @@ void navigation_markroutes(entity this, entity fixed_source_waypoint) fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs); fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; fixed_source_waypoint.wpfire = 1; - fixed_source_waypoint.enemy = world; + fixed_source_waypoint.enemy = NULL; } else { @@ -621,7 +621,7 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint) w.wpnearestpoint = '0 0 0'; w.wpcost = 10000000; w.wpfire = 0; - w.enemy = world; + w.enemy = NULL; w = w.chain; } @@ -631,7 +631,7 @@ void navigation_markroutes_inverted(entity fixed_source_waypoint) fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs); fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint fixed_source_waypoint.wpfire = 1; - fixed_source_waypoint.enemy = world; + fixed_source_waypoint.enemy = NULL; } else { @@ -882,7 +882,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition) else e = e.enemy; // we already have added it, so... - if(e == world) + if(e == NULL) return false; for (;;) @@ -891,7 +891,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition) navigation_pushroute(this, e); e = e.enemy; - if(e==world) + if(e==NULL) break; } @@ -955,7 +955,7 @@ void navigation_poptouchedgoals(entity this) { if(vdist(this.origin - this.goalcurrent.origin, <, 150)) { - traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, world); + traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, NULL); if(trace_fraction==1) { // Detect personal waypoints @@ -991,12 +991,12 @@ void navigation_goalrating_start(entity this) if(this.aistatus & AI_STATUS_STUCK) return; - this.navigation_jetpack_goal = world; + this.navigation_jetpack_goal = NULL; navigation_bestrating = -1; this.navigation_hasgoals = false; navigation_clearroute(this); - navigation_bestgoal = world; - navigation_markroutes(this, world); + navigation_bestgoal = NULL; + navigation_markroutes(this, NULL); } // ends a goal selection session (updates goal stack to the best goal) @@ -1030,7 +1030,7 @@ void botframe_updatedangerousobjects(float maxupdate) c = 0; bot_dodgelist = findchainfloat(bot_dodge, true); botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint"); - while (botframe_dangerwaypoint != world) + while (botframe_dangerwaypoint != NULL) { danger = 0; m1 = botframe_dangerwaypoint.mins; @@ -1046,7 +1046,7 @@ void botframe_updatedangerousobjects(float maxupdate) d = head.bot_dodgerating - vlen(o - v); if (d > 0) { - traceline(o, v, true, world); + traceline(o, v, true, NULL); if (trace_fraction == 1) danger = danger + d; } @@ -1071,7 +1071,7 @@ void navigation_unstuck(entity this) { LOG_DEBUG(strcat(this.netname, " sutck, taking over the waypoints queue\n")); bot_waypoint_queue_owner = this; - bot_waypoint_queue_bestgoal = world; + bot_waypoint_queue_bestgoal = NULL; bot_waypoint_queue_bestgoalrating = 0; } @@ -1107,7 +1107,7 @@ void navigation_unstuck(entity this) LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n")); } - bot_waypoint_queue_owner = world; + bot_waypoint_queue_owner = NULL; } } else @@ -1120,7 +1120,7 @@ void navigation_unstuck(entity this) entity head, first; - first = world; + first = NULL; head = findradius(this.origin, search_radius); while(head) @@ -1134,7 +1134,7 @@ void navigation_unstuck(entity this) first = head; bot_waypoint_queue_goal = head; - bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = world; + bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = NULL; } head = head.chain; @@ -1145,7 +1145,7 @@ void navigation_unstuck(entity this) else { LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n")); - bot_waypoint_queue_owner = world; + bot_waypoint_queue_owner = NULL; } } } @@ -1168,7 +1168,7 @@ void debugnode(entity this, vector node) return; } - te_lightning2(world, node, debuglastnode); + te_lightning2(NULL, node, debuglastnode); debuglastnode = node; } @@ -1237,9 +1237,9 @@ void debuggoalstack(entity this) else if(this.goalcounter==29)goal=this.goalstack29; else if(this.goalcounter==30)goal=this.goalstack30; else if(this.goalcounter==31)goal=this.goalstack31; - else goal=world; + else goal=NULL; - if(goal==world) + if(goal==NULL) { this.goalcounter = 0; this.lastposition='0 0 0'; @@ -1253,7 +1253,7 @@ void debuggoalstack(entity this) go = ( goal.absmin + goal.absmax ) * 0.5; - te_lightning2(world, org, go); + te_lightning2(NULL, org, go); this.lastposition = go; this.goalcounter++; diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 77d410653a..3734ad8501 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -125,7 +125,7 @@ entity bot_getplace(entity this, string placename) cvar_set(placename, strcat(substring(s2, p+1, -1), " ", s)); //print("places: ", placename, " := ", cvar_string(placename), "\n"); } - e = find(world, targetname, s); + e = find(NULL, targetname, s); if(!e) LOG_INFO("invalid place ", s, "\n"); if(i < MAX_BOT_PLACES) @@ -138,7 +138,7 @@ entity bot_getplace(entity this, string placename) } else { - e = find(world, targetname, placename); + e = find(NULL, targetname, placename); if(!e) LOG_INFO("invalid place ", placename, "\n"); return e; @@ -240,7 +240,7 @@ entity find_bot_by_name(string name) bot = bot.chain; } - return world; + return NULL; } // Returns a bot by number on list @@ -250,7 +250,7 @@ entity find_bot_by_number(float number) float c = 0; if(!number) - return world; + return NULL; bot = findchainflags(flags, FL_CLIENT); while (bot) @@ -263,7 +263,7 @@ entity find_bot_by_number(float number) bot = bot.chain; } - return world; + return NULL; } float bot_decodecommand(string cmdstring) @@ -612,7 +612,7 @@ float bot_cmd_eval(entity this, string expr) case "speed": return vlen(this.velocity); case "flagcarrier": - return ((this.flagcarried!=world)); + return ((this.flagcarried!=NULL)); } LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n")); @@ -1111,7 +1111,7 @@ void bot_command_executed(entity this, bool rm) void bot_setcurrentcommand(entity this) { - bot_cmd = world; + bot_cmd = NULL; if(!this.bot_cmd_current) { @@ -1134,13 +1134,13 @@ void bot_setcurrentcommand(entity this) else { // Invalid command, remove from queue - bot_cmd = world; + bot_cmd = NULL; bot_dequeuecommand(this, this.bot_cmd_execution_index); this.bot_cmd_execution_index++; } } else - bot_cmd = world; + bot_cmd = NULL; } } @@ -1175,7 +1175,7 @@ float bot_execute_commands_once(entity this) // old logic kept pressing previously pressed keys, but that has problems // (namely, it means you cannot make a bot "normal" ever again) // to keep a bot walking for a while, use the "wait" bot command - if(bot_cmd == world) + if(bot_cmd == NULL) return false; // Ignore all commands except continue when the bot is paused diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index e606038792..e8322c2e0c 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -18,7 +18,7 @@ entity waypoint_spawn(vector m1, vector m2, float f) { entity w; - w = find(world, classname, "waypoint"); + w = find(NULL, classname, "waypoint"); if (!(f & WAYPOINTFLAG_PERSONAL)) while (w) @@ -47,7 +47,7 @@ entity waypoint_spawn(vector m1, vector m2, float f) { LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n"); remove(w); - return world; + return NULL; } else { @@ -175,7 +175,7 @@ void waypoint_think(entity this) //dprint("waypoint_think wpisbox = ", ftos(this.wpisbox), "\n"); sm1 = this.origin + this.mins; sm2 = this.origin + this.maxs; - for(e = world; (e = find(e, classname, "waypoint")); ) + for(e = NULL; (e = find(e, classname, "waypoint")); ) { if (boxesoverlap(this.absmin, this.absmax, e.absmin, e.absmax)) { @@ -226,7 +226,7 @@ void waypoint_think(entity this) ev = trace_endpos + '0 0 1'; } } - //traceline(this.origin, e.origin, false, world); + //traceline(this.origin, e.origin, false, NULL); //if (trace_fraction == 1) if (!this.wpisbox && tracewalk(this, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS)) waypoint_addlink(this, e); @@ -247,10 +247,10 @@ void waypoint_clearlinks(entity wp) // clear links to other waypoints float f; f = 10000000; - wp.wp00 = wp.wp01 = wp.wp02 = wp.wp03 = wp.wp04 = wp.wp05 = wp.wp06 = wp.wp07 = world; - wp.wp08 = wp.wp09 = wp.wp10 = wp.wp11 = wp.wp12 = wp.wp13 = wp.wp14 = wp.wp15 = world; - wp.wp16 = wp.wp17 = wp.wp18 = wp.wp19 = wp.wp20 = wp.wp21 = wp.wp22 = wp.wp23 = world; - wp.wp24 = wp.wp25 = wp.wp26 = wp.wp27 = wp.wp28 = wp.wp29 = wp.wp30 = wp.wp31 = world; + wp.wp00 = wp.wp01 = wp.wp02 = wp.wp03 = wp.wp04 = wp.wp05 = wp.wp06 = wp.wp07 = NULL; + wp.wp08 = wp.wp09 = wp.wp10 = wp.wp11 = wp.wp12 = wp.wp13 = wp.wp14 = wp.wp15 = NULL; + wp.wp16 = wp.wp17 = wp.wp18 = wp.wp19 = wp.wp20 = wp.wp21 = wp.wp22 = wp.wp23 = NULL; + wp.wp24 = wp.wp25 = wp.wp26 = wp.wp27 = wp.wp28 = wp.wp29 = wp.wp30 = wp.wp31 = NULL; wp.wp00mincost = wp.wp01mincost = wp.wp02mincost = wp.wp03mincost = wp.wp04mincost = wp.wp05mincost = wp.wp06mincost = wp.wp07mincost = f; wp.wp08mincost = wp.wp09mincost = wp.wp10mincost = wp.wp11mincost = wp.wp12mincost = wp.wp13mincost = wp.wp14mincost = wp.wp15mincost = f; @@ -263,7 +263,7 @@ void waypoint_clearlinks(entity wp) // tell a spawnfunc_waypoint to relink void waypoint_schedulerelink(entity wp) { - if (wp == world) + if (wp == NULL) return; // TODO: add some sort of visible box in edit mode for box waypoints if (autocvar_g_waypointeditor) @@ -283,9 +283,9 @@ void waypoint_schedulerelink(entity wp) else wp.model = ""; wp.wpisbox = vlen(wp.size) > 0; - wp.enemy = world; + wp.enemy = NULL; if (!(wp.wpflags & WAYPOINTFLAG_PERSONAL)) - wp.owner = world; + wp.owner = NULL; if (!(wp.wpflags & WAYPOINTFLAG_NORELINK)) waypoint_clearlinks(wp); // schedule an actual relink on next frame @@ -375,7 +375,7 @@ float waypoint_load_links() { string filename, s; float file, tokens, c = 0, found; - entity wp_from = world, wp_to; + entity wp_from = NULL, wp_to; vector wp_to_pos, wp_from_pos; filename = strcat("maps/", mapname); filename = strcat(filename, ".waypoints.cache"); @@ -463,7 +463,7 @@ void waypoint_load_links_hardwired() { string filename, s; float file, tokens, c = 0, found; - entity wp_from = world, wp_to; + entity wp_from = NULL, wp_to; vector wp_to_pos, wp_from_pos; filename = strcat("maps/", mapname); filename = strcat(filename, ".waypoints.hardwired"); @@ -583,7 +583,7 @@ entity waypoint_get_link(entity w, float i) case 29:return w.wp29; case 30:return w.wp30; case 31:return w.wp31; - default:return world; + default:return NULL; } } @@ -610,7 +610,7 @@ void waypoint_save_links() { // :S link = waypoint_get_link(w, i); - if(link==world) + if(link==NULL) continue; s = strcat(vtos(w.origin), "*", vtos(link.origin), "\n"); @@ -715,10 +715,10 @@ float waypoint_loadall() vector waypoint_fixorigin(vector position) { - tracebox(position + '0 0 1' * (1 - STAT(PL_MIN, NULL).z), STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), position + '0 0 -512', MOVE_NOMONSTERS, world); + tracebox(position + '0 0 1' * (1 - STAT(PL_MIN, NULL).z), STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), position + '0 0 -512', MOVE_NOMONSTERS, NULL); if(trace_fraction < 1) position = trace_endpos; - //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, world); + //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, NULL); //print("position is ", ftos(trace_endpos_z - position_z), " above solid\n"); return position; } @@ -801,7 +801,7 @@ entity waypoint_spawnpersonal(entity this, vector position) position = waypoint_fixorigin(position); w = waypoint_spawn(position, position, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_PERSONAL); - w.nearestwaypoint = world; + w.nearestwaypoint = NULL; w.nearestwaypointtimeout = 0; w.owner = this; @@ -825,39 +825,39 @@ void botframe_showwaypointlinks() //navigation_testtracewalk = false; if (head) { - w = head ;if (w) te_lightning2(world, w.origin, it.origin); - w = head.wp00;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp01;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp02;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp03;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp04;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp05;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp06;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp07;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp08;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp09;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp10;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp11;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp12;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp13;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp14;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp15;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp16;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp17;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp18;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp19;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp20;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp21;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp22;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp23;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp24;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp25;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp26;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp27;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp28;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp29;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp30;if (w) te_lightning2(world, w.origin, head.origin); - w = head.wp31;if (w) te_lightning2(world, w.origin, head.origin); + w = head ;if (w) te_lightning2(NULL, w.origin, it.origin); + w = head.wp00;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp01;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp02;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp03;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp04;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp05;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp06;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp07;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp08;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp09;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp10;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp11;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp12;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp13;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp14;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp15;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp16;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp17;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp18;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp19;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp20;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp21;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp22;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp23;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp24;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp25;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp26;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp27;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp28;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp29;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp30;if (w) te_lightning2(NULL, w.origin, head.origin); + w = head.wp31;if (w) te_lightning2(NULL, w.origin, head.origin); } } )); @@ -865,7 +865,7 @@ void botframe_showwaypointlinks() float botframe_autowaypoints_fixdown(vector v) { - tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, world); + tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, NULL); if(trace_fraction >= 1) return 0; return 1; @@ -875,7 +875,7 @@ float botframe_autowaypoints_createwp(vector v, entity p, .entity fld, float f) { entity w; - w = find(world, classname, "waypoint"); + w = find(NULL, classname, "waypoint"); while (w) { // if a matching spawnfunc_waypoint already exists, don't add a duplicate @@ -897,7 +897,7 @@ float botframe_autowaypoints_createwp(vector v, entity p, .entity fld, float f) float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .entity fld) { // make it possible to go from p to wp, if we can - // if wp is world, nearest is chosen + // if wp is NULL, nearest is chosen entity w; vector porg; @@ -928,7 +928,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en float bestdist; bestdist = maxdist; - w = find(world, classname, "waypoint"); + w = find(NULL, classname, "waypoint"); while (w) { if(w != wp && !(w.wpflags & WAYPOINTFLAG_NORELINK)) @@ -1038,7 +1038,7 @@ void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld) float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld); if(r != -1) return; - r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld); + r = botframe_autowaypoints_fix_from(p, walkfromwp, NULL, fld); if(r != -1) return; @@ -1052,14 +1052,14 @@ void botframe_deleteuselesswaypoints() { entity w, w1, w2; float i, j, k; - for (w = world; (w = findfloat(w, bot_pickup, true)); ) + for (w = NULL; (w = findfloat(w, bot_pickup, true)); ) { // NOTE: this protects waypoints if they're the ONLY nearest // waypoint. That's the intention. navigation_findnearestwaypoint(w, false); // Walk TO item. navigation_findnearestwaypoint(w, true); // Walk FROM item. } - for (w = world; (w = find(w, classname, "waypoint")); ) + for (w = NULL; (w = find(w, classname, "waypoint")); ) { w.wpflags |= WAYPOINTFLAG_DEAD_END; w.wpflags &= ~WAYPOINTFLAG_USEFUL; @@ -1074,7 +1074,7 @@ void botframe_deleteuselesswaypoints() // This has been done above by protecting these WPs. } // c) There are w1, w, w2 so that w1 -> w, w -> w2 and not w1 -> w2. - for (w1 = world; (w1 = find(w1, classname, "waypoint")); ) + for (w1 = NULL; (w1 = find(w1, classname, "waypoint")); ) { if (w1.wpflags & WAYPOINTFLAG_PERSONAL) continue; @@ -1116,7 +1116,7 @@ LABEL(next) // d) The waypoint is a dead end. Dead end waypoints must be kept as // they are needed to complete routes while autowaypointing. - for (w = world; (w = find(w, classname, "waypoint")); ) + for (w = NULL; (w = find(w, classname, "waypoint")); ) { if (!(w.wpflags & (WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END))) { @@ -1126,7 +1126,7 @@ LABEL(next) break; } } - for (w = world; (w = find(w, classname, "waypoint")); ) + for (w = NULL; (w = find(w, classname, "waypoint")); ) w.wpflags &= ~(WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END); // temp flag } diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 19a1e25bdd..9706a2f159 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -107,7 +107,7 @@ float num_autoscreenshot; void info_autoscreenshot_findtarget(entity this) { entity e; - e = find(world, targetname, this.target); + e = find(NULL, targetname, this.target); if(!e) { objerror(this, "Missing target. FAIL!"); @@ -234,7 +234,7 @@ float CheatImpulse(entity this, int imp) IS_CHEAT(this, imp, 0, 0); if(this.movetype == MOVETYPE_NOCLIP) { - e = find(world, classname, "info_autoscreenshot"); + e = find(NULL, classname, "info_autoscreenshot"); if(e) { sprint(this, "Emergency teleport used info_autoscreenshot location\n"); @@ -273,7 +273,7 @@ float CheatImpulse(entity this, int imp) e2 = spawn(); setorigin(e2, e.origin); - RadiusDamage(e2, this, 1000, 0, 128, world, world, 500, DEATH_CHEAT.m_id, e); + RadiusDamage(e2, this, 1000, 0, 128, NULL, NULL, 500, DEATH_CHEAT.m_id, e); remove(e2); LOG_INFO("404 Sportsmanship not found.\n"); @@ -474,9 +474,9 @@ float CheatCommand(entity this, int argc) IS_CHEAT(this, 0, argc, 0); RandomSelection_Init(); crosshair_trace(this); - for(entity e = world; (e = find(e, classname, "dragbox_box")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); - for(entity e = world; (e = find(e, classname, "dragpoint")); ) + for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { @@ -496,9 +496,9 @@ float CheatCommand(entity this, int argc) { RandomSelection_Init(); crosshair_trace(this); - for(entity e = world; (e = find(e, classname, "dragbox_box")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); - for(entity e = world; (e = find(e, classname, "dragpoint")); ) + for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { @@ -518,11 +518,11 @@ float CheatCommand(entity this, int argc) { f = fopen(argv(1), FILE_WRITE); fputs(f, "cmd drag_clear\n"); - for(entity e = world; (e = find(e, classname, "dragbox_box")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) { fputs(f, strcat("cmd dragbox_spawn ", ftos(e.cnt), " \"", vtos(e.aiment.origin), "\" \"", vtos(e.enemy.origin), "\"\n")); } - for(entity e = world; (e = find(e, classname, "dragpoint")); ) + for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) { fputs(f, strcat("cmd dragpoint_spawn ", ftos(e.cnt), " \"", vtos(e.origin), "\"\n")); } @@ -537,7 +537,7 @@ float CheatCommand(entity this, int argc) if(argc == 2) { f = fopen(argv(1), FILE_WRITE); - for(entity e = world; (e = find(e, classname, "dragbox_box")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) { fputs(f, "{\n"); fputs(f, "\"classname\" \"trigger_race_checkpoint\"\n"); @@ -547,11 +547,11 @@ float CheatCommand(entity this, int argc) fputs(f, strcat("\"targetname\" \"checkpoint", ftos(e.cnt), "\"\n")); fputs(f, "}\n"); } - for(entity e = world; (e = find(e, classname, "dragpoint")); ) + for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) { start = '0 0 0'; effectnum = 0; - for(entity ent = world; (ent = find(ent, classname, "dragbox_box")); ) + for(entity ent = NULL; (ent = find(ent, classname, "dragbox_box")); ) { if(e.cnt <= 0 && ent.cnt == 0 || e.cnt == ent.cnt) { @@ -582,7 +582,7 @@ float CheatCommand(entity this, int argc) // these need race_place // counting... effectnum = 1; - for(entity ent = world; (ent = find(ent, classname, "dragpoint")); ) + for(entity ent = NULL; (ent = find(ent, classname, "dragpoint")); ) if(ent.cnt == 0) { if(vlen2(ent.origin - start) < vlen2(e.origin - start)) @@ -603,15 +603,15 @@ float CheatCommand(entity this, int argc) break; case "drag_clear": IS_CHEAT(this, 0, argc, 0); - for(entity e = world; (e = find(e, classname, "dragbox_box")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) remove(e); - for(entity e = world; (e = find(e, classname, "dragbox_corner_1")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_corner_1")); ) remove(e); - for(entity e = world; (e = find(e, classname, "dragbox_corner_2")); ) + for(entity e = NULL; (e = find(e, classname, "dragbox_corner_2")); ) remove(e); - for(entity e = world; (e = find(e, classname, "dragpoint")); ) + for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) remove(e); - for(entity e = world; (e = find(e, classname, "drag_digit")); ) + for(entity e = NULL; (e = find(e, classname, "drag_digit")); ) remove(e); DID_CHEAT(); break; @@ -892,8 +892,8 @@ void Drag_Finish(entity dragger) entity draggee; draggee = dragger.dragentity; if(dragger) - dragger.dragentity = world; - draggee.draggedby = world; + dragger.dragentity = NULL; + draggee.draggedby = NULL; draggee.movetype = draggee.dragmovetype; draggee.gravity = draggee.draggravity; @@ -922,7 +922,7 @@ void Drag_Finish(entity dragger) float Drag_IsDraggable(entity draggee) { // TODO add more checks for bad stuff here - if(draggee == world) + if(draggee == NULL) return false; if(draggee.classname == "func_bobbing") return false; @@ -1018,7 +1018,7 @@ float Drag_IsDragging(entity dragger) return false; if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger) { - dragger.dragentity = world; + dragger.dragentity = NULL; return false; } if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity)) @@ -1035,7 +1035,7 @@ void Drag_MoveDrag(entity from, entity to) { to.draggedby = from.draggedby; to.draggedby.dragentity = to; - from.draggedby = world; + from.draggedby = NULL; } } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 968a9899f2..28d9c6c1a0 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -247,7 +247,7 @@ void PutObserverInServer(entity this) if (this.killcount != FRAGS_SPECTATOR) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); if(!intermission_running) if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2)) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS); @@ -798,7 +798,7 @@ void ClientKill_Now(entity this) if(this.killindicator && !wasfreed(this.killindicator)) remove(this.killindicator); - this.killindicator = world; + this.killindicator = NULL; if(this.killindicator_teamchange) ClientKill_Now_TeamChange(this); @@ -812,14 +812,14 @@ void KillIndicator_Think(entity this) { if (gameover) { - this.owner.killindicator = world; + this.owner.killindicator = NULL; remove(this); return; } if (this.owner.alpha < 0 && !this.owner.vehicle) { - this.owner.killindicator = world; + this.owner.killindicator = NULL; remove(this); return; } @@ -896,7 +896,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, this.killindicator.count = bound(0, ceil(killtime), 10); //sprint(this, strcat("^1You'll be dead in ", ftos(this.killindicator.cnt), " seconds\n")); - for(e = world; (e = find(e, classname, "body")) != world; ) + for(e = NULL; (e = find(e, classname, "body")) != NULL; ) { if(e.enemy != this) continue; @@ -1185,7 +1185,7 @@ void ClientDisconnect() if (autocvar_sv_eventlog) GameLogEcho(strcat(":part:", ftos(this.playerid))); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname); MUTATOR_CALLHOOK(ClientDisconnect, this); @@ -1223,8 +1223,8 @@ void ChatBubbleThink(entity this) this.nextthink = time; if ((this.owner.alpha < 0) || this.owner.chatbubbleentity != this) { - if(this.owner) // but why can that ever be world? - this.owner.chatbubbleentity = world; + if(this.owner) // but why can that ever be NULL? + this.owner.chatbubbleentity = NULL; remove(this); return; } @@ -1340,7 +1340,7 @@ void player_powerups(entity this) if (time > this.strength_finished) { this.items = this.items - (this.items & ITEM_Strength.m_itemid); - //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_STRENGTH, this.netname); + //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERDOWN_STRENGTH, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_STRENGTH); } } @@ -1349,7 +1349,7 @@ void player_powerups(entity this) if (time < this.strength_finished) { this.items = this.items | ITEM_Strength.m_itemid; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_STRENGTH); } } @@ -1360,7 +1360,7 @@ void player_powerups(entity this) if (time > this.invincible_finished) { this.items = this.items - (this.items & ITEM_Shield.m_itemid); - //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SHIELD, this.netname); + //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERDOWN_SHIELD, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_SHIELD); } } @@ -1369,7 +1369,7 @@ void player_powerups(entity this) if (time < this.invincible_finished) { this.items = this.items | ITEM_Shield.m_itemid; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SHIELD, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SHIELD, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_SHIELD); } } @@ -1379,7 +1379,7 @@ void player_powerups(entity this) { this.superweapons_finished = 0; this.items = this.items - (this.items & IT_SUPERWEAPON); - //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname); + //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_LOST); } else if (this.items & IT_UNLIMITED_SUPERWEAPONS) @@ -1393,7 +1393,7 @@ void player_powerups(entity this) { this.items = this.items - (this.items & IT_SUPERWEAPON); this.weapons &= ~WEPSET_SUPERWEAPONS; - //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname); + //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN); } } @@ -1403,7 +1403,7 @@ void player_powerups(entity this) if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS)) { this.items = this.items | IT_SUPERWEAPON; - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname); Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP); } else @@ -1800,7 +1800,7 @@ void LeaveSpectatorMode(entity this) WITHSELF(this, PutClientInServer()); - if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); } + if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); } } else stuffcmd(this, "menu_showteamselect\n"); @@ -2026,7 +2026,7 @@ void PlayerUseKey(entity this) if(!IS_DEAD(this)) if(!gameover) { - entity head, closest_target = world; + entity head, closest_target = NULL; head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true); while(head) // find the closest acceptable target to enter @@ -2164,7 +2164,7 @@ void PlayerPreThink () if(!IS_DEAD(this)) { entity veh; - for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); ) + for(veh = NULL; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); ) if(vdist(veh.origin - this.origin, <, autocvar_g_vehicles_enter_radius)) if(!IS_DEAD(veh)) if(veh.takedamage != DAMAGE_NO) @@ -2401,7 +2401,7 @@ void DrownPlayer(entity this) { // drown! if (this.pain_finished < time) { - Damage (this, world, world, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, this.origin, '0 0 0'); this.pain_finished = time + 0.5; } } @@ -2438,7 +2438,7 @@ void PlayerPostThink () Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft); } if (timeleft <= 0) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname); dropclient(this); return; } diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 6de25fa10f..517ee37961 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -554,7 +554,7 @@ IMPULSE(navwaypoint_unreachable) for (entity e = findchain(classname, "info_player_deathmatch"); e; e = e.chain) { vector org = e.origin; - tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, world); + tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, NULL); setorigin(e, trace_endpos); if (navigation_findnearestwaypoint(e, false)) { diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 914df8a93a..4c54dddaa6 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -529,7 +529,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, if(this.killindicator) { remove(this.killindicator); - this.killindicator = world; + this.killindicator = NULL; if(this.killindicator_teamchange) defer_ClientKill_Now_TeamChange = true; diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 1cbc699aef..2ede443b36 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -176,7 +176,7 @@ void ClientCommand_join(entity caller, float request) TRANSMUTE(Player, caller); PlayerScore_Clear(caller); Kill_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CPID_PREVENT_JOIN); - Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname); WITHSELF(caller, PutClientInServer()); } else @@ -292,7 +292,7 @@ void ClientCommand_say(entity caller, float request, float argc, string command) { case CMD_REQUEST_COMMAND: { - if (argc >= 2) Say(caller, false, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); + if (argc >= 2) Say(caller, false, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); return; // never fall through to usage } @@ -312,7 +312,7 @@ void ClientCommand_say_team(entity caller, float request, float argc, string com { case CMD_REQUEST_COMMAND: { - if (argc >= 2) Say(caller, true, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); + if (argc >= 2) Say(caller, true, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1); return; // never fall through to usage } @@ -560,7 +560,7 @@ void ClientCommand_tell(entity caller, float request, float argc, string command } else if (argv(1) == "#0") { - trigger_magicear_processmessage_forallears(caller, -1, world, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token))); + trigger_magicear_processmessage_forallears(caller, -1, NULL, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token))); return; } else { print_to(caller, strcat("tell: ", GetClientErrorString(tell_accepted, argv(1)), ".")); return; } diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index ae0a02538a..3c97737e54 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -80,7 +80,7 @@ entity GetIndexedEntity(float argc, float start_index) next_token = -1; index = start_index; - selection = world; + selection = NULL; if (argc > start_index) { @@ -147,7 +147,7 @@ entity GetFilteredEntity(string input) } else { - selection = world; + selection = NULL; FOREACH_CLIENT(true, LAMBDA( if(strdecolorize(it.netname) == strdecolorize(input)) { @@ -200,10 +200,10 @@ void timeout_handler_think(entity this) { if (timeout_time > 0) // countdown is still going { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); if (timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only seconds are left - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_PREPARE); this.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second timeout_time -= 1; // decrease the time counter @@ -230,7 +230,7 @@ void timeout_handler_think(entity this) { if (timeout_leadtime > 0) // countdown is still going { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); this.nextthink = time + 1; // think again in one second timeout_leadtime -= 1; // decrease the time counter @@ -400,7 +400,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; } if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; } - Damage(mon, world, world, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0'); + Damage(mon, NULL, NULL, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0'); print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated")); return; } @@ -740,7 +740,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMA setthink(timeout_handler, timeout_handler_think); timeout_handler.nextthink = time; // always let the entity think asap - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_TIMEOUT); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TIMEOUT); } } else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); } diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index dd1d5deafd..b12977823e 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -30,7 +30,7 @@ float FullTraceFraction(vector a, vector mi, vector ma, vector b) { ++m; - tracebox(c, mi, ma, b, MOVE_WORLDONLY, world); + tracebox(c, mi, ma, b, MOVE_WORLDONLY, NULL); ++n; if (!trace_startsolid) @@ -39,7 +39,7 @@ float FullTraceFraction(vector a, vector mi, vector ma, vector b) c = trace_endpos; } - n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, false, world); + n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, NULL, false, NULL); white += vlen(trace_endpos - c); c = trace_endpos; @@ -90,7 +90,7 @@ float RadarMapAtPoint_LineBlock(float x, float y, float w, float h, float zmin, v2_x += random() * (ma.x - mi.x); v2_y += random() * (ma.y - mi.y); v2_z += random() * (ma.z - mi.z); - traceline(v1, v2, MOVE_WORLDONLY, world); + traceline(v1, v2, MOVE_WORLDONLY, NULL); if (trace_startsolid || trace_fraction < 1) ++r; } return r / q; @@ -117,7 +117,7 @@ float RadarMapAtPoint_Block(float x, float y, float w, float h, float zmin, floa r = 0; for (i = 0; i < q; ++i) { - tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, world); + tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, NULL); if (trace_startsolid) ++r; } return r / q; @@ -145,7 +145,7 @@ float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, flo v.x = a.x + random() * b.x; v.y = a.y + random() * b.y; v.z = a.z + random() * b.z; - traceline(v, v, MOVE_WORLDONLY, world); + traceline(v, v, MOVE_WORLDONLY, NULL); if (trace_startsolid) ++c; } @@ -208,7 +208,7 @@ void RadarMap_Next() GotoNextMap(0); } remove(radarmapper); - radarmapper = world; + radarmapper = NULL; } void RadarMap_Think(entity this) { @@ -254,7 +254,7 @@ void RadarMap_Think(entity this) { LOG_INFO("Error writing ", this.netname, "\n"); remove(this); - radarmapper = world; + radarmapper = NULL; return; } LOG_INFO("Writing to ", this.netname, "...\n"); @@ -440,7 +440,7 @@ float RadarMap_Make(float argc) default: i = argc; remove(radarmapper); - radarmapper = world; + radarmapper = NULL; break; } } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 37c994d68e..895318affc 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -264,7 +264,7 @@ void GameCommand_bbox(float request) '0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z, '1 0 0' * world.absmax.x, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.x)); else LOG_INFO(" ", ftos(trace_endpos.x)); @@ -273,7 +273,7 @@ void GameCommand_bbox(float request) '1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z, '0 1 0' * world.absmax.y, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.y)); else LOG_INFO(" ", ftos(trace_endpos.y)); @@ -282,7 +282,7 @@ void GameCommand_bbox(float request) '1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y, '0 0 1' * world.absmax.z, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.z)); else LOG_INFO(" ", ftos(trace_endpos.z)); @@ -291,7 +291,7 @@ void GameCommand_bbox(float request) '0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z, '1 0 0' * world.absmin.x, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.x)); else LOG_INFO(" ", ftos(trace_endpos.x)); @@ -300,7 +300,7 @@ void GameCommand_bbox(float request) '1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z, '0 1 0' * world.absmin.y, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.y)); else LOG_INFO(" ", ftos(trace_endpos.y)); @@ -309,7 +309,7 @@ void GameCommand_bbox(float request) '1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y, '0 0 1' * world.absmin.z, MOVE_WORLDONLY, - world); + NULL); if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.z)); else LOG_INFO(" ", ftos(trace_endpos.z)); @@ -386,7 +386,7 @@ void GameCommand_bot_cmd(float request, float argc, string command) { // let's start at token 2 so we can skip sv_cmd bot_cmd bot = find_bot_by_number(stof(argv(2))); - if (bot == world) bot = find_bot_by_name(argv(2)); + if (bot == NULL) bot = find_bot_by_name(argv(2)); if (bot) bot_queuecommand(bot, substring(s, argv_start_index(3), -1)); } } @@ -410,7 +410,7 @@ void GameCommand_bot_cmd(float request, float argc, string command) else if (argc >= 3) // this comes last { bot = find_bot_by_number(stof(argv(1))); - if (bot == world) bot = find_bot_by_name(argv(1)); + if (bot == NULL) bot = find_bot_by_name(argv(1)); if (bot) { LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n")); @@ -448,7 +448,7 @@ void GameCommand_cointoss(float request, float argc) string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS"); string choice = ((random() > 0.5) ? result1 : result2); - Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice); + Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, MULTI_COINTOSS, choice); return; } @@ -799,7 +799,7 @@ void GameCommand_gettaginfo(float request, float argc) if (argv(1) == "w") { .entity weaponentity = weaponentities[0]; - _setmodel(tmp_entity, (nextent(world)).(weaponentity).model); + _setmodel(tmp_entity, (nextent(NULL)).(weaponentity).model); } else { @@ -860,7 +860,7 @@ void GameCommand_animbench(float request, float argc) if (argv(1) == "w") { .entity weaponentity = weaponentities[0]; - _setmodel(tmp_entity, (nextent(world)).(weaponentity).model); + _setmodel(tmp_entity, (nextent(NULL)).(weaponentity).model); } else { @@ -1507,15 +1507,15 @@ void GameCommand_trace(float request, float argc) start = stov(vtos(start)); end = stov(vtos(end)); - tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world); + tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL); if (!trace_startsolid && trace_fraction < 1) { p = trace_endpos; - tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, world); + tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, NULL); if (trace_startsolid) { rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid - tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world); + tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL); // how much do we need to back off? safe = 1; @@ -1523,7 +1523,7 @@ void GameCommand_trace(float request, float argc) for ( ; ; ) { pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5); - tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, world); + tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, NULL); if (trace_startsolid) { if ((safe + unsafe) * 0.5 == unsafe) break; @@ -1539,7 +1539,7 @@ void GameCommand_trace(float request, float argc) LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n"); LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n"); - tracebox(p, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world); + tracebox(p, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL); if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n"); else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n"); if (++hitcount >= 10) break; @@ -1553,7 +1553,7 @@ void GameCommand_trace(float request, float argc) { q = p + normalize(end - p) * (dq + dqf); if (q == q0) break; - tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, world); + tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, NULL); if (trace_startsolid) error("THIS ONE cannot happen"); if (trace_fraction > 0) dq += dqf * trace_fraction; dqf *= 0.5; @@ -1574,7 +1574,7 @@ void GameCommand_trace(float request, float argc) case "debug2": { - e = nextent(world); + e = nextent(NULL); tracebox(e.origin + '0 0 32', e.mins, e.maxs, e.origin + '0 0 -1024', MOVE_NORMAL, e); vv = trace_endpos; if (trace_fraction == 1) @@ -1607,7 +1607,7 @@ void GameCommand_trace(float request, float argc) { if (argc == 4) { - e = nextent(world); + e = nextent(NULL); if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk\n"); else LOG_INFO("cannot walk\n"); return; @@ -1620,9 +1620,9 @@ void GameCommand_trace(float request, float argc) { vv = stov(argv(2)); dv = stov(argv(3)); - traceline(vv, dv, MOVE_NORMAL, world); - __trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos); - __trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv); + traceline(vv, dv, MOVE_NORMAL, NULL); + __trailparticles(NULL, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos); + __trailparticles(NULL, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv); return; } } @@ -1826,7 +1826,7 @@ void GameCommand(string command) BanCommand_macro_help(); LOG_INFO("\nCommon networked commands:\n"); - CommonCommand_macro_help(world); + CommonCommand_macro_help(NULL); LOG_INFO("\nGeneric commands shared by all programs:\n"); GenericCommand_macro_help(); @@ -1840,7 +1840,7 @@ void GameCommand(string command) { return; } - else if (CommonCommand_macro_usage(argc, world)) // same here, but for common commands instead + else if (CommonCommand_macro_usage(argc, NULL)) // same here, but for common commands instead { return; } @@ -1861,7 +1861,7 @@ void GameCommand(string command) { return; // handled by server/command/ipban.qc } - else if (CommonCommand_macro_command(argc, world, command)) + else if (CommonCommand_macro_command(argc, NULL, command)) { return; // handled by server/command/common.qc } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index d02caa390f..337b428c55 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -128,7 +128,7 @@ void VoteReset() } vote_called = VOTE_NULL; - vote_caller = world; + vote_caller = NULL; vote_caller_name = string_null; vote_endtime = 0; @@ -160,21 +160,21 @@ void VoteAccept() if (vote_caller) vote_caller.vote_waittime = 0; // people like your votes, you don't need to wait to vote again VoteReset(); - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_ACCEPT); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_ACCEPT); } void VoteReject() { bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote for ", vote_called_display, "^2 was rejected\n"); VoteReset(); - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_FAIL); } void VoteTimeout() { bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote for ", vote_called_display, "^2 timed out\n"); VoteReset(); - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_FAIL); } void VoteSpam(float notvoters, float mincount, string result) @@ -801,7 +801,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm } FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(++tmp_playercount)); - if (tmp_playercount > 1) Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_CALL); // don't announce a "vote now" sound if player is alone + if (tmp_playercount > 1) Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_CALL); // don't announce a "vote now" sound if player is alone bprint("\{1}^2* ^3", OriginalCallerName(), "^2 calls a vote for ", vote_called_display, "\n"); if (autocvar_sv_eventlog) GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 8b7d7c1594..4fbccc7b02 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -123,7 +123,7 @@ string AppendItemcodes(string s, entity player) s = strcat(s, "S"); if(time < player.invincible_finished) s = strcat(s, "I"); - if(player.flagcarried != world) + if(player.flagcarried != NULL) s = strcat(s, "F"); if(PHYS_INPUT_BUTTON_CHAT(player)) s = strcat(s, "T"); @@ -344,7 +344,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype) Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname); Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount); // In this case, the death message will ALWAYS be "foo was betrayed by bar" // No need for specific death/weapon messages... @@ -547,7 +547,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo // add waypoint if(show_waypoint) - WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT); + WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT); } void Unfreeze (entity targ) @@ -570,7 +570,7 @@ void Unfreeze (entity targ) // remove the ice block if(targ.iceblock) remove(targ.iceblock); - targ.iceblock = world; + targ.iceblock = NULL; } void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) @@ -708,7 +708,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d Unfreeze(targ); targ.health = autocvar_g_frozen_revive_falldamage_health; Send_Effect(EFFECT_ICEORGLASS, targ.origin, '0 0 0', 3); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname); Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF); } @@ -1259,7 +1259,7 @@ void fireburner_think(entity this) Fire_ApplyEffect(this.owner); if(!Fire_IsBurning(this.owner)) { - this.owner.fire_burner = world; + this.owner.fire_burner = NULL; remove(this); return; } diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index f5f37c673a..b22a81e042 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -72,10 +72,10 @@ And you should be done! void RemoveGrapplingHook(entity pl) { - if(pl.hook == world) + if(pl.hook == NULL) return; remove(pl.hook); - pl.hook = world; + pl.hook = NULL; if(pl.movetype == MOVETYPE_FLY) pl.movetype = MOVETYPE_WALK; diff --git a/qcsrc/server/g_lights.qc b/qcsrc/server/g_lights.qc index 849ba53583..41366f5ea2 100644 --- a/qcsrc/server/g_lights.qc +++ b/qcsrc/server/g_lights.qc @@ -47,7 +47,7 @@ void dynlight_find_aiment(entity this) if (!this.target) objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); this.movetype = MOVETYPE_FOLLOW; this.aiment = targ; this.owner = targ; @@ -63,7 +63,7 @@ void dynlight_find_path(entity this) if (!this.target) objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); this.target = targ.target; setorigin(this, targ.origin); setthink(this, train_next); @@ -75,7 +75,7 @@ void dynlight_find_target(entity this) if (!this.target) objerror (this, "dynlight: no target to follow"); - targ = find(world, targetname, this.target); + targ = find(NULL, targetname, this.target); setattachment(this, targ, this.dtagname); this.owner = targ; setthink(this, dynlight_think); diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index e2b7ba269b..1b12174b99 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -212,12 +212,12 @@ vector findbetterlocation (vector org, float mindist) c = 0; while (c < 6) { - traceline (org, org + vec, true, world); + traceline (org, org + vec, true, NULL); vec = vec * -1; if (trace_fraction < 1) { loc = trace_endpos; - traceline (loc, loc + vec, true, world); + traceline (loc, loc + vec, true, NULL); if (trace_fraction >= 1) org = loc + vec; } @@ -277,7 +277,7 @@ void LODmodel_attach(entity this) if(this.lodtarget1 != "") { - e = find(world, targetname, this.lodtarget1); + e = find(NULL, targetname, this.lodtarget1); if(e) { this.lodmodel1 = e.model; @@ -286,7 +286,7 @@ void LODmodel_attach(entity this) } if(this.lodtarget2 != "") { - e = find(world, targetname, this.lodtarget2); + e = find(NULL, targetname, this.lodtarget2); if(e) { this.lodmodel2 = e.model; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 7cb5f69803..56bc0b34d8 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -489,7 +489,7 @@ void detect_maptype() o.y += random() * (world.maxs.y - world.mins.y); o.z += random() * (world.maxs.z - world.mins.z); - tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 32768', MOVE_WORLDONLY, world); + tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 32768', MOVE_WORLDONLY, NULL); if(trace_fraction == 1) continue; @@ -497,7 +497,7 @@ void detect_maptype() for(i = 0; i < 64; i += 4) { - tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, world); + tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, NULL); if(trace_fraction == 1) continue; LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n"); @@ -664,7 +664,7 @@ spawnfunc(worldspawn) compressShortVector_init(); maxclients = 0; - for (entity head = nextent(world); head; head = nextent(head)) + for (entity head = nextent(NULL); head; head = nextent(head)) { ++maxclients; } @@ -1335,7 +1335,7 @@ entity FindIntermission() local float cyc; // look for info_intermission first - spot = find (world, classname, "info_intermission"); + spot = find (NULL, classname, "info_intermission"); if (spot) { // pick a random one cyc = random() * 4; @@ -1350,22 +1350,22 @@ entity FindIntermission() } // then look for the start position - spot = find (world, classname, "info_player_start"); + spot = find (NULL, classname, "info_player_start"); if (spot) return spot; // testinfo_player_start is only found in regioned levels - spot = find (world, classname, "testplayerstart"); + spot = find (NULL, classname, "testplayerstart"); if (spot) return spot; // then look for the start position - spot = find (world, classname, "info_player_deathmatch"); + spot = find (NULL, classname, "info_player_deathmatch"); if (spot) return spot; //objerror ("FindIntermission: no spot"); - return world; + return NULL; } */ @@ -1421,7 +1421,7 @@ void DumpStats(float final) fputs(file, strcat(s, "\n")); } - s = strcat(":labels:player:", GetPlayerScoreString(world, 0)); + s = strcat(":labels:player:", GetPlayerScoreString(NULL, 0)); if(to_console) LOG_INFO(s, "\n"); if(to_eventlog) @@ -1549,7 +1549,7 @@ void NextLevel() PlayerStats_GameReport(true); WeaponStats_Shutdown(); - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_Null); // kill all centerprints now + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_Null); // kill all centerprints now if(autocvar_sv_eventlog) GameLogEcho(":gameover"); @@ -1626,7 +1626,7 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true tl += autocvar_timelimit_overtime; cvar_set("timelimit", ftos(tl)); - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60); } float GetWinningCode(float fraglimitreached, float equality) @@ -1717,11 +1717,11 @@ float WinningCondition_Scores(float limit, float leadlimit) if (limit) if (leaderfrags == limit - 1) - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_1); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1); else if (leaderfrags == limit - 2) - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_2); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2); else if (leaderfrags == limit - 3) - Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_3); + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3); } } @@ -1798,7 +1798,7 @@ float WinningCondition_RanOutOfSpawns() t = NUM_TEAM_3; else // if(team4_score) t = NUM_TEAM_4; - CheckAllowedTeams(world); + CheckAllowedTeams(NULL); for(i = 0; i < MAX_TEAMSCORE; ++i) { if(t != NUM_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(NUM_TEAM_1, i, -1000); @@ -1879,9 +1879,9 @@ void CheckRules_World() { checkrules_suddendeathwarning = true; if(g_race && !g_race_qualifying) - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_RACE_FINISHLAP); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_RACE_FINISHLAP); else - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_FRAG); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_FRAG); } } else diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 999919fbe6..b3a496f41e 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -522,7 +522,7 @@ float MapVote_CheckRules_2() for(i = 0; i < mapvote_count_real; ++i) if ( mapvote_maps_flags[i] & GTV_AVAILABLE ) { - RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]); + RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]); if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) ) { currentVotes = mapvote_selections[i]; @@ -542,7 +542,7 @@ float MapVote_CheckRules_2() for(i = 0; i < mapvote_count_real; ++i) if(i != firstPlace) if ( mapvote_maps_flags[i] & GTV_AVAILABLE ) - RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]); + RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]); secondPlace = RandomSelection_chosen_float; secondPlaceVotes = RandomSelection_best_priority; //dprint("Second place: ", ftos(secondPlace), "\n"); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 5369f9f2d6..2c206cf1a7 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -122,7 +122,7 @@ entity findnearest(vector point, .string field, string value, vector axismod) float num_nearest; num_nearest = 0; - localhead = find(world, field, value); + localhead = find(NULL, field, value); while (localhead) { if ((localhead.items == IT_KEY1 || localhead.items == IT_KEY2) && localhead.target == "###item###") @@ -160,7 +160,7 @@ entity findnearest(vector point, .string field, string value, vector axismod) // now use the first one from our list that we can see for (i = 0; i < num_nearest; ++i) { - traceline(point, nearest_entity[i].origin, true, world); + traceline(point, nearest_entity[i].origin, true, NULL); if (trace_fraction == 1) { if (i != 0) @@ -174,7 +174,7 @@ entity findnearest(vector point, .string field, string value, vector axismod) } if (num_nearest == 0) - return world; + return NULL; LOG_TRACE("Not seeing any location point, using nearest as fallback.\n"); /* DEBUGGING CODE: @@ -796,7 +796,7 @@ void make_safe_for_remove(entity e) { if (e.initialize_entity) { - entity ent, prev = world; + entity ent, prev = NULL; for (ent = initialize_entity_first; ent; ) { if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e))) @@ -860,7 +860,7 @@ void InitializeEntity(entity e, void(entity this) func, float order) e.initialize_entity_order = order; cur = initialize_entity_first; - prev = world; + prev = NULL; for (;;) { if (!cur || cur.initialize_entity_order > order) @@ -1037,7 +1037,7 @@ bool SUB_NoImpactCheck(entity this, entity toucher) } if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) return true; - if (toucher == world && this.size != '0 0 0') + if (toucher == NULL && this.size != '0 0 0') { vector tic; tic = this.velocity * sys_frametime; @@ -1196,13 +1196,13 @@ float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundma continue; // rule 4: we must "see" some spawnpoint or item - for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); ) + for(sp = NULL; (sp = find(sp, classname, "info_player_deathmatch")); ) if(checkpvs(mstart, sp)) if((traceline(mstart, sp.origin, MOVE_NORMAL, e), trace_fraction) >= 1) break; if(!sp) { - for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); ) + for(sp = NULL; (sp = findflags(sp, flags, FL_ITEM)); ) if(checkpvs(mstart, sp)) if((traceline(mstart, sp.origin + (sp.mins + sp.maxs) * 0.5, MOVE_NORMAL, e), trace_fraction) >= 1) break; @@ -1313,7 +1313,7 @@ void detach_sameorigin(entity e) else e.angles = AnglesTransform_ToAngles(e.angles); setorigin(e, org); - setattachment(e, world, ""); + setattachment(e, NULL, ""); setorigin(e, e.origin); } @@ -1363,7 +1363,7 @@ void UnsetMovetypeFollow(entity ent) { ent.movetype = MOVETYPE_FLY; PROJECTILE_MAKETRIGGER(ent); - ent.aiment = world; + ent.aiment = NULL; } float LostMovetypeFollow(entity ent) { diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 55f4e1496c..6fbce15b95 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -19,7 +19,7 @@ MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer); /** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */ #define EV_PlayerSpawn(i, o) \ /** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \ - /** spot that was used, or world */ i(entity, MUTATOR_ARGV_1_entity) \ + /** spot that was used, or NULL */ i(entity, MUTATOR_ARGV_1_entity) \ /**/ MUTATOR_HOOKABLE(PlayerSpawn, EV_PlayerSpawn); diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 8c9a01e27c..938cdd748b 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -76,7 +76,7 @@ void assault_objective_use(entity this, entity actor, entity trigger) //print("^2Activated objective ", this.targetname, "=", etos(this), "\n"); //print("Activator is ", actor.classname, "\n"); - for (entity e = world; (e = find(e, target, this.targetname)); ) + for (entity e = NULL; (e = find(e, target, this.targetname)); ) { if (e.classname == "target_objective_decrease") { @@ -112,7 +112,7 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger) { WaypointSprite_Disown(trigger.assault_sprite, waypointsprite_deadlifetime); if(trigger.classname == "func_assault_destructible") - trigger.sprite = world; // TODO: just unsetting it?! + trigger.sprite = NULL; // TODO: just unsetting it?! } else return; // already activated! cannot activate again! @@ -141,11 +141,11 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger) void assault_setenemytoobjective(entity this) { entity objective; - for(objective = world; (objective = find(objective, targetname, this.target)); ) + for(objective = NULL; (objective = find(objective, targetname, this.target)); ) { if(objective.classname == "target_objective") { - if(this.enemy == world) + if(this.enemy == NULL) this.enemy = objective; else objerror(this, "more than one objective as target - fix the map!"); @@ -153,7 +153,7 @@ void assault_setenemytoobjective(entity this) } } - if(this.enemy == world) + if(this.enemy == NULL) objerror(this, "no objective as target - fix the map!"); } @@ -168,14 +168,14 @@ bool assault_decreaser_sprite_visible(entity this, entity player, entity view) void target_objective_decrease_activate(entity this) { entity ent, spr; - this.owner = world; - for(ent = world; (ent = find(ent, target, this.targetname)); ) + this.owner = NULL; + for(ent = NULL; (ent = find(ent, target, this.targetname)); ) { - if(ent.assault_sprite != world) + if(ent.assault_sprite != NULL) { WaypointSprite_Disown(ent.assault_sprite, waypointsprite_deadlifetime); if(ent.classname == "func_assault_destructible") - ent.sprite = world; // TODO: just unsetting it?! + ent.sprite = NULL; // TODO: just unsetting it?! } spr = WaypointSprite_SpawnFixed(WP_Assault, 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite, RADARICON_OBJECTIVE); @@ -302,7 +302,7 @@ int WinningCondition_Assault() } entity ent; - ent = find(world, classname, "target_assault_roundend"); + ent = find(NULL, classname, "target_assault_roundend"); if(ent) { if(ent.winning) // round end has been triggered by attacking team @@ -366,7 +366,7 @@ spawnfunc(target_objective_decrease) this.use = assault_objective_decrease_use; this.health = ASSAULT_VALUE_INACTIVE; this.max_health = ASSAULT_VALUE_INACTIVE; - this.enemy = world; + this.enemy = NULL; InitializeEntity(this, target_objective_decrease_findtarget, INITPRIO_FINDTARGET); } @@ -441,7 +441,7 @@ void havocbot_goalrating_ast_targets(entity this, float ratingscale) continue; found = false; - for(tod = world; (tod = find(tod, targetname, ad.target)); ) + for(tod = NULL; (tod = find(tod, targetname, ad.target)); ) { if(tod.classname == "target_objective_decrease") { @@ -465,11 +465,11 @@ void havocbot_goalrating_ast_targets(entity this, float ratingscale) p = 0.5 * (ad.absmin + ad.absmax); // dprint(vtos(ad.origin), " ", vtos(ad.absmin), " ", vtos(ad.absmax),"\n"); // te_knightspike(p); - // te_lightning2(world, '0 0 0', p); + // te_lightning2(NULL, '0 0 0', p); // Find and rate waypoints around it found = false; - best = world; + best = NULL; bestvalue = 99999999999; for(radius=0; radius<1500 && !found; radius+=500) { @@ -492,7 +492,7 @@ void havocbot_goalrating_ast_targets(entity this, float ratingscale) if(best) { /// dprint("waypoints around target were found\n"); - // te_lightning2(world, '0 0 0', best.origin); + // te_lightning2(NULL, '0 0 0', best.origin); // te_knightspike(best.origin); navigation_routerating(this, best, ratingscale, 4000); diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index fe31e37cc0..901a04f2a7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -122,8 +122,8 @@ float CA_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); allowed_to_spawn = false; round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit); FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it))); @@ -137,14 +137,14 @@ float CA_CheckWinner() int winner_team = CA_GetWinnerTeam(); if(winner_team > 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); TeamScore_AddToTeam(winner_team, ST_CA_ROUNDS, +1); } else if(winner_team == -1) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED); } allowed_to_spawn = false; @@ -168,14 +168,14 @@ bool CA_CheckTeams() if(CA_ALIVE_TEAMS_OK()) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; return true; } if(total_players == 0) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; return false; } @@ -184,7 +184,7 @@ bool CA_CheckTeams() if(ca_teams >= 4) missing_teams_mask += (!pinkalive) * 8; if(prev_missing_teams_mask != missing_teams_mask) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); prev_missing_teams_mask = missing_teams_mask; } return false; diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index ade9cfa3b6..70a2c040bf 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -125,8 +125,8 @@ void ctf_FakeTimeLimit(entity e, float t) void ctf_EventLog(string mode, int flagteam, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) - GameLogEcho(sprintf(":ctf:%s:%d:%d:%s", mode, flagteam, actor.team, ((actor != world) ? ftos(actor.playerid) : ""))); - //GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); + GameLogEcho(sprintf(":ctf:%s:%d:%d:%s", mode, flagteam, actor.team, ((actor != NULL) ? ftos(actor.playerid) : ""))); + //GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : ""))); } void ctf_CaptureRecord(entity flag, entity player) @@ -136,10 +136,10 @@ void ctf_CaptureRecord(entity flag, entity player) string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname")); // notify about shit - if(ctf_oneflag) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CTF_CAPTURE_NEUTRAL, player.netname); } - else if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_TIME), player.netname, (cap_time * 100)); } - else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_BROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); } - else { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_UNBROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); } + if(ctf_oneflag) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CTF_CAPTURE_NEUTRAL, player.netname); } + else if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_TIME), player.netname, (cap_time * 100)); } + else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_BROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); } + else { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_UNBROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); } // write that shit in the database if(!ctf_oneflag) // but not in 1-flag mode @@ -154,7 +154,7 @@ void ctf_CaptureRecord(entity flag, entity player) void ctf_FlagcarrierWaypoints(entity player) { - WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, true, RADARICON_FLAG); + WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, NULL, player.team, player, wps_flagcarrier, true, RADARICON_FLAG); WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2); WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id)); WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, WPCOLOR_FLAGCARRIER(player.team)); @@ -337,7 +337,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype) flag.ctf_status = FLAG_DROPPED; // messages and sounds - Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_LOST) : INFO_CTF_LOST_NEUTRAL), player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_LOST) : INFO_CTF_LOST_NEUTRAL), player.netname); _sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE); ctf_EventLog("dropped", player.team, player); @@ -347,7 +347,7 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype) // waypoints if(autocvar_g_ctf_flag_dropped_waypoint) { - entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG); + entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, NULL, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG); wp.colormod = WPCOLOR_DROPPEDFLAG(flag.team); } @@ -362,8 +362,8 @@ void ctf_Handle_Drop(entity flag, entity player, int droptype) if(droptype == DROP_PASS) { flag.pass_distance = 0; - flag.pass_sender = world; - flag.pass_target = world; + flag.pass_sender = NULL; + flag.pass_target = NULL; } } @@ -413,8 +413,8 @@ void ctf_Handle_Retrieve(entity flag, entity player) player.throw_antispam = sender.throw_antispam; flag.pass_distance = 0; - flag.pass_sender = world; - flag.pass_target = world; + flag.pass_sender = NULL; + flag.pass_target = NULL; } void ctf_Handle_Throw(entity player, entity receiver, int droptype) @@ -428,10 +428,10 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) if(flag.speedrunning) { ctf_RespawnFlag(flag); return; } // reset the flag - setattachment(flag, world, ""); + setattachment(flag, NULL, ""); setorigin(flag, player.origin + FLAG_DROP_OFFSET); - flag.owner.flagcarried = world; - flag.owner = world; + flag.owner.flagcarried = NULL; + flag.owner = NULL; flag.solid = SOLID_TRIGGER; flag.ctf_dropper = player; flag.ctf_droptime = time; @@ -461,7 +461,7 @@ void ctf_Handle_Throw(entity player, entity receiver, int droptype) // other _sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM); - WarpZone_TrailParticles(world, _particleeffectnum(flag.passeffect), player.origin, targ_origin); + WarpZone_TrailParticles(NULL, _particleeffectnum(flag.passeffect), player.origin, targ_origin); ctf_EventLog("pass", flag.team, player); break; } @@ -517,7 +517,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) { entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher); entity player = ((capturetype == CAPTURE_NORMAL) ? toucher : enemy_flag.ctf_dropper); - entity player_team_flag = world, tmp_entity; + entity player_team_flag = NULL, tmp_entity; float old_time, new_time; if(!player) { return; } // without someone to give the reward to, we can't possibly cap @@ -581,12 +581,12 @@ void ctf_Handle_Return(entity flag, entity player) // messages and sounds if(IS_MONSTER(player)) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN_MONSTER), player.monster_name); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN_MONSTER), player.monster_name); } else if(flag.team) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT(flag, CENTER_CTF_RETURN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN), player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN), player.netname); } _sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE); ctf_EventLog("return", flag.team, player); @@ -652,7 +652,7 @@ void ctf_Handle_Pickup(entity flag, entity player, int pickuptype) } // messages and sounds - Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_PICKUP) : INFO_CTF_PICKUP_NEUTRAL), player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_PICKUP) : INFO_CTF_PICKUP_NEUTRAL), player.netname); if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); } if(!flag.team) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PICKUP_NEUTRAL); } else if(CTF_DIFFTEAM(player, flag)) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT(flag, CENTER_CTF_PICKUP)); } @@ -731,17 +731,17 @@ void ctf_CheckFlagReturn(entity flag, int returntype) { switch(returntype) { - case RETURN_DROPPED: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DROPPED) : INFO_CTF_FLAGRETURN_DROPPED_NEUTRAL)); break; - case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DAMAGED) : INFO_CTF_FLAGRETURN_DAMAGED_NEUTRAL)); break; - case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_SPEEDRUN) : INFO_CTF_FLAGRETURN_SPEEDRUN_NEUTRAL), ctf_captimerecord); break; - case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_NEEDKILL) : INFO_CTF_FLAGRETURN_NEEDKILL_NEUTRAL)); break; + case RETURN_DROPPED: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DROPPED) : INFO_CTF_FLAGRETURN_DROPPED_NEUTRAL)); break; + case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DAMAGED) : INFO_CTF_FLAGRETURN_DAMAGED_NEUTRAL)); break; + case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_SPEEDRUN) : INFO_CTF_FLAGRETURN_SPEEDRUN_NEUTRAL), ctf_captimerecord); break; + case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_NEEDKILL) : INFO_CTF_FLAGRETURN_NEEDKILL_NEUTRAL)); break; default: case RETURN_TIMEOUT: - { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_TIMEOUT) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; } + { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_TIMEOUT) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; } } _sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE); - ctf_EventLog("returned", flag.team, world); + ctf_EventLog("returned", flag.team, NULL); ctf_RespawnFlag(flag); } } @@ -768,7 +768,7 @@ void ctf_CheckStalemate() int stale_flags = 0, stale_red_flags = 0, stale_blue_flags = 0, stale_yellow_flags = 0, stale_pink_flags = 0, stale_neutral_flags = 0; entity tmp_entity; - entity ctf_staleflaglist = world; // reset the list, we need to build the list each time this function runs + entity ctf_staleflaglist = NULL; // reset the list, we need to build the list each time this function runs // build list of stale flags for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext) @@ -812,7 +812,7 @@ void ctf_CheckStalemate() { if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier)) { - entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG); + entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, NULL, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG); wp.colormod = WPCOLOR_ENEMYFC(tmp_entity.owner.team); setcefc(tmp_entity.owner.wps_enemyflagcarrier, ctf_Stalemate_Customize); } @@ -957,7 +957,7 @@ void ctf_FlagThink(entity this) if(CTF_SAMETEAM(this, this.owner) && this.team) { if(autocvar_g_ctf_flag_return) // drop the flag if reverse status has changed - ctf_Handle_Throw(this.owner, world, DROP_THROW); + ctf_Handle_Throw(this.owner, NULL, DROP_THROW); else if(vdist(this.owner.origin - this.ctf_spawnorigin, <=, autocvar_g_ctf_flag_return_carried_radius)) ctf_Handle_Return(this, this.owner); } @@ -970,7 +970,7 @@ void ctf_FlagThink(entity this) targ_origin = WarpZone_RefSys_TransformOrigin(this.pass_target, this, targ_origin); // origin of target as seen by the flag (us) WarpZone_TraceLine(this.origin, targ_origin, MOVE_NOMONSTERS, this); - if((this.pass_target == world) + if((this.pass_target == NULL) || (IS_DEAD(this.pass_target)) || (this.pass_target.flagcarried) || (vdist(this.origin - targ_origin, <, autocvar_g_ctf_pass_radius)) @@ -978,7 +978,7 @@ void ctf_FlagThink(entity this) || (time > this.ctf_droptime + autocvar_g_ctf_pass_timelimit)) { // give up, pass failed - ctf_Handle_Drop(this, world, DROP_PASS); + ctf_Handle_Drop(this, NULL, DROP_PASS); } else { @@ -1111,7 +1111,7 @@ void ctf_RespawnFlag(entity flag) WaypointSprite_Kill(flag.owner.wps_enemyflagcarrier); WaypointSprite_Kill(flag.wps_flagcarrier); - flag.owner.flagcarried = world; + flag.owner.flagcarried = NULL; if(flag.speedrunning) ctf_FakeTimeLimit(flag.owner, -1); @@ -1124,7 +1124,7 @@ void ctf_RespawnFlag(entity flag) { WaypointSprite_Kill(flag.wps_flagdropped); } // reset the flag - setattachment(flag, world, ""); + setattachment(flag, NULL, ""); setorigin(flag, flag.ctf_spawnorigin); flag.movetype = ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS); @@ -1136,11 +1136,11 @@ void ctf_RespawnFlag(entity flag) flag.flags = FL_ITEM | FL_NOTARGET; flag.ctf_status = FLAG_BASE; - flag.owner = world; + flag.owner = NULL; flag.pass_distance = 0; - flag.pass_sender = world; - flag.pass_target = world; - flag.ctf_dropper = world; + flag.pass_sender = NULL; + flag.pass_target = NULL; + flag.ctf_dropper = NULL; flag.ctf_pickuptime = 0; flag.ctf_droptime = 0; flag.ctf_flagdamaged = 0; @@ -1151,7 +1151,7 @@ void ctf_RespawnFlag(entity flag) void ctf_Reset(entity this) { if(this.owner && IS_PLAYER(this.owner)) - ctf_Handle_Throw(this.owner, world, DROP_RESET); + ctf_Handle_Throw(this.owner, NULL, DROP_RESET); ctf_RespawnFlag(this); } @@ -1190,7 +1190,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist ctf_worldflaglist = flag; - setattachment(flag, world, ""); + setattachment(flag, NULL, ""); flag.netname = strzone(sprintf("%s%s^7 flag", Team_ColorCode(teamnumber), Team_ColorName_Upper(teamnumber))); flag.team = teamnumber; @@ -1330,7 +1330,7 @@ entity havocbot_ctf_find_flag(entity bot) return f; f = f.ctf_worldflagnext; } - return world; + return NULL; } entity havocbot_ctf_find_enemy_flag(entity bot) @@ -1356,7 +1356,7 @@ entity havocbot_ctf_find_enemy_flag(entity bot) return f; f = f.ctf_worldflagnext; } - return world; + return NULL; } int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius) @@ -1473,7 +1473,7 @@ void havocbot_goalrating_ctf_droppedflags(entity this, float ratingscale, vector { // flag is out in the field if(head.ctf_status != FLAG_BASE) - if(head.tag_entity==world) // dropped + if(head.tag_entity==NULL) // dropped { if(df_radius) { @@ -1581,7 +1581,7 @@ void havocbot_role_ctf_carrier(entity this) return; } - if (this.flagcarried == world) + if (this.flagcarried == NULL) { havocbot_ctf_reset_role(this); return; @@ -1899,7 +1899,7 @@ void havocbot_role_ctf_defense(entity this) navigation_goalrating_start(this); // if enemies are closer to our base, go there - entity closestplayer = world; + entity closestplayer = NULL; float distance, bestdistance = 10000; FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA( distance = vlen(org - it.origin); @@ -2075,8 +2075,8 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerDies) if(frag_target.flagcarried) { entity tmp_entity = frag_target.flagcarried; - ctf_Handle_Throw(frag_target, world, DROP_NORMAL); - tmp_entity.ctf_dropper = world; + ctf_Handle_Throw(frag_target, NULL, DROP_NORMAL); + tmp_entity.ctf_dropper = NULL; } } @@ -2089,13 +2089,13 @@ MUTATOR_HOOKFUNCTION(ctf, GiveFragsForKill) void ctf_RemovePlayer(entity player) { if(player.flagcarried) - { ctf_Handle_Throw(player, world, DROP_NORMAL); } + { ctf_Handle_Throw(player, NULL, DROP_NORMAL); } for(entity flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) { - if(flag.pass_sender == player) { flag.pass_sender = world; } - if(flag.pass_target == player) { flag.pass_target = world; } - if(flag.ctf_dropper == player) { flag.ctf_dropper = world; } + if(flag.pass_sender == player) { flag.pass_sender = NULL; } + if(flag.pass_target == player) { flag.pass_target = NULL; } + if(flag.ctf_dropper == player) { flag.ctf_dropper = NULL; } } } @@ -2119,7 +2119,7 @@ MUTATOR_HOOKFUNCTION(ctf, PortalTeleport) if(player.flagcarried) if(!autocvar_g_ctf_portalteleport) - { ctf_Handle_Throw(player, world, DROP_NORMAL); } + { ctf_Handle_Throw(player, NULL, DROP_NORMAL); } } MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) @@ -2133,7 +2133,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) // pass the flag to a team mate if(autocvar_g_ctf_pass) { - entity head, closest_target = world; + entity head, closest_target = NULL; head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, true); while(head) // find the closest acceptable target to pass to @@ -2190,7 +2190,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) { player.throw_prevtime = time; player.throw_count = 1; - ctf_Handle_Throw(player, world, DROP_THROW); + ctf_Handle_Throw(player, NULL, DROP_THROW); return true; } else @@ -2206,7 +2206,7 @@ MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) if(player.throw_count >= autocvar_g_ctf_throw_punish_count) { player.throw_count = -1; } player.throw_prevtime = time; - ctf_Handle_Throw(player, world, DROP_THROW); + ctf_Handle_Throw(player, NULL, DROP_THROW); return true; } } @@ -2224,7 +2224,7 @@ MUTATOR_HOOKFUNCTION(ctf, HelpMePing) } else // create a normal help me waypointsprite { - WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_helpme, false, RADARICON_HELPME); + WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, player, FLAG_WAYPOINT_OFFSET, NULL, player.team, player, wps_helpme, false, RADARICON_HELPME); WaypointSprite_Ping(player.wps_helpme); } @@ -2242,7 +2242,7 @@ MUTATOR_HOOKFUNCTION(ctf, VehicleEnter) if(!autocvar_g_ctf_allow_vehicle_carry && !autocvar_g_ctf_allow_vehicle_touch) { - ctf_Handle_Throw(player, world, DROP_NORMAL); + ctf_Handle_Throw(player, NULL, DROP_NORMAL); } else { @@ -2265,7 +2265,7 @@ MUTATOR_HOOKFUNCTION(ctf, VehicleExit) setorigin(player.flagcarried, FLAG_CARRY_OFFSET); player.flagcarried.scale = FLAG_SCALE; player.flagcarried.angles = '0 0 0'; - player.flagcarried.nodrawtoclient = world; + player.flagcarried.nodrawtoclient = NULL; return true; } } @@ -2276,7 +2276,7 @@ MUTATOR_HOOKFUNCTION(ctf, AbortSpeedrun) if(player.flagcarried) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, ((player.flagcarried.team) ? APP_TEAM_ENT(player.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN) : INFO_CTF_FLAGRETURN_ABORTRUN_NEUTRAL)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((player.flagcarried.team) ? APP_TEAM_ENT(player.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN) : INFO_CTF_FLAGRETURN_ABORTRUN_NEUTRAL)); ctf_RespawnFlag(player.flagcarried); return true; } @@ -2410,7 +2410,7 @@ MUTATOR_HOOKFUNCTION(ctf, DropSpecialItems) entity frag_target = M_ARGV(0, entity); if(frag_target.flagcarried) - ctf_Handle_Throw(frag_target, world, DROP_THROW); + ctf_Handle_Throw(frag_target, NULL, DROP_THROW); } @@ -2544,7 +2544,7 @@ spawnfunc(team_neutralobelisk) { spawnfunc_item_flag_neutral(this); } // scoreboard setup void ctf_ScoreRules(int teams) { - CheckAllowedTeams(world); + CheckAllowedTeams(NULL); ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true); ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); @@ -2581,7 +2581,7 @@ void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait f ctf_teams = bound(2, ctf_teams, 4); // if no teams are found, spawn defaults - if(find(world, classname, "ctf_team") == world) + if(find(NULL, classname, "ctf_team") == NULL) { LOG_TRACE("No \"ctf_team\" entities found on this map, creating them anyway.\n"); ctf_SpawnTeam("Red", NUM_TEAM_1 - 1); @@ -2603,7 +2603,7 @@ void ctf_Initialize() ctf_captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio; ctf_captureshield_force = autocvar_g_ctf_shield_force; - InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, ctf_DelayedInit, INITPRIO_GAMETYPE); } #endif diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index a308925fba..bfddc30b01 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -93,7 +93,7 @@ void cts_ScoreRules() void cts_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) - GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); + GameLogEcho(strcat(":cts:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : ""))); } void KillIndicator_Think(entity this); @@ -184,7 +184,7 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global) { float s; - Score_NicePrint(world); + Score_NicePrint(NULL); race_ClearRecords(); PlayerScore_Sort(race_place, 0, 1, 0); @@ -407,7 +407,7 @@ MUTATOR_HOOKFUNCTION(cts, ClientKill) if(player.killindicator && player.killindicator.health == 1) // player.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill { remove(player.killindicator); - player.killindicator = world; + player.killindicator = NULL; ClientKill_Now(player); // allow instant kill in this case return; diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index eed44a789b..6a217133a7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -82,7 +82,7 @@ int autocvar_g_domination_teams_override; void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) - GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); + GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : ""))); } void set_dom_state(entity e) @@ -107,7 +107,7 @@ void dompoint_captured(entity this) this.cnt = -1; dom_EventLog("taken", this.team, this.dmg_inflictor); - this.dmg_inflictor = world; + this.dmg_inflictor = NULL; this.goalentity = head; this.model = head.mdl; @@ -127,12 +127,12 @@ void dompoint_captured(entity this) if(domination_roundbased) bprint(sprintf("^3%s^3%s\n", head.netname, this.message)); else - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time); if(this.enemy.playerid == this.enemy_playerid) PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1); else - this.enemy = world; + this.enemy = NULL; if (head.noise != "") if(this.enemy) @@ -165,7 +165,7 @@ void dompoint_captured(entity this) WaypointSprite_UpdateSprites(this.sprite, msg, WP_Null, WP_Null); total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0; - for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; ) + for(head = NULL; (head = find(head, classname, "dom_controlpoint")) != NULL; ) FOREACH_ENTITY_CLASS("dom_controlpoint", true, LAMBDA( if (autocvar_g_domination_point_amt) points = autocvar_g_domination_point_amt; @@ -246,7 +246,7 @@ void dompointthink(entity this) PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt); } else - this.enemy = world; + this.enemy = NULL; } } @@ -264,7 +264,7 @@ void dompointtouch(entity this) return; // only valid teams can claim it - entity head = find(world, classname, "dom_team"); + entity head = find(NULL, classname, "dom_team"); while (head && head.team != other.team) head = find(head, classname, "dom_team"); if (!head || head.netname == "" || head == this.goalentity) @@ -284,10 +284,10 @@ void dompointtouch(entity this) //this.think = dompoint_captured; // go to neutral team in the mean time - head = find(world, classname, "dom_team"); + head = find(NULL, classname, "dom_team"); while (head && head.netname != "") head = find(head, classname, "dom_team"); - if(head == world) + if(head == NULL) return; WaypointSprite_UpdateSprites(this.sprite, WP_DomNeut, WP_Null, WP_Null); @@ -308,7 +308,7 @@ void dom_controlpoint_setup(entity this) { entity head; // find the spawnfunc_dom_team representing unclaimed points - head = find(world, classname, "dom_team"); + head = find(NULL, classname, "dom_team"); while(head && head.netname != "") head = find(head, classname, "dom_team"); if (!head) @@ -364,7 +364,7 @@ void Domination_count_controlpoints() { entity e; total_controlpoints = redowned = blueowned = yellowowned = pinkowned = 0; - for(e = world; (e = find(e, classname, "dom_controlpoint")) != world; ) + for(e = NULL; (e = find(e, classname, "dom_controlpoint")) != NULL; ) { ++total_controlpoints; redowned += (e.goalentity.team == NUM_TEAM_1); @@ -405,8 +405,8 @@ float Domination_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); return 1; } @@ -420,14 +420,14 @@ float Domination_CheckWinner() if(winner_team > 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); TeamScore_AddToTeam(winner_team, ST_DOM_CAPS, +1); } else if(winner_team == -1) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED); } round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); @@ -469,7 +469,7 @@ MUTATOR_HOOKFUNCTION(dom, GetTeamCount) M_ARGV(0, float) = domination_teams; string ret_string = "dom_team"; - entity head = find(world, classname, ret_string); + entity head = find(NULL, classname, ret_string); while(head) { if(head.netname != "") @@ -678,14 +678,14 @@ void dom_spawnteams(int teams) void dom_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up. { // if no teams are found, spawn defaults - if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2) + if(find(NULL, classname, "dom_team") == NULL || autocvar_g_domination_teams_override >= 2) { LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.\n"); domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4); dom_spawnteams(domination_teams); } - CheckAllowedTeams(world); + CheckAllowedTeams(NULL); domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2); domination_roundbased = autocvar_g_domination_roundbased; @@ -702,7 +702,7 @@ void dom_DelayedInit(entity this) // Do this check with a delay so we can wait f void dom_Initialize() { g_domination = true; - InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, dom_DelayedInit, INITPRIO_GAMETYPE); } #endif diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index 12e4df68ad..6db1db73d4 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -99,14 +99,14 @@ float freezetag_CheckTeams() if(FREEZETAG_ALIVE_TEAMS_OK()) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; return 1; } if(total_players == 0) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; return 0; } @@ -115,7 +115,7 @@ float freezetag_CheckTeams() if(freezetag_teams >= 4) missing_teams_mask += (!pinkalive) * 8; if(prev_missing_teams_mask != missing_teams_mask) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); prev_missing_teams_mask = missing_teams_mask; } return 0; @@ -150,8 +150,8 @@ float freezetag_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( it.freezetag_frozen_timeout = 0; nades_Clear(it); @@ -166,14 +166,14 @@ float freezetag_CheckWinner() int winner_team = freezetag_getWinnerTeam(); if(winner_team > 0) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); TeamScore_AddToTeam(winner_team, ST_SCORE, +1); } else if(winner_team == -1) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED); } FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( @@ -186,7 +186,7 @@ float freezetag_CheckWinner() entity freezetag_LastPlayerForTeam(entity this) { - entity last_pl = world; + entity last_pl = NULL; FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA( if(it.health >= 1) if(!STAT(FROZEN, it)) @@ -194,7 +194,7 @@ entity freezetag_LastPlayerForTeam(entity this) if(!last_pl) last_pl = it; else - return world; + return NULL; )); return last_pl; } @@ -416,11 +416,11 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) freezetag_Freeze(frag_target, frag_attacker); freezetag_LastPlayerForTeam_Notify(frag_target); - if(frag_attacker == frag_target || frag_attacker == world) + if(frag_attacker == frag_target || frag_attacker == NULL) { if(IS_PLAYER(frag_target)) Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_SELF); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname); } else { @@ -428,7 +428,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies) Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_FROZEN, frag_attacker.netname); if(IS_PLAYER(frag_attacker)) Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_FREEZETAG_FREEZE, frag_target.netname); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname); } return true; @@ -443,7 +443,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) if(player.freezetag_frozen_timeout == -2) // player was dead { - freezetag_Freeze(player, world); + freezetag_Freeze(player, NULL); return true; } @@ -453,7 +453,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn) if(round_handler_IsRoundStarted()) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE); - freezetag_Freeze(player, world); + freezetag_Freeze(player, NULL); } return true; @@ -497,7 +497,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) int n; entity o; - o = world; + o = NULL; //if(STAT(FROZEN, player)) //if(player.freezetag_frozen_timeout > 0 && time < player.freezetag_frozen_timeout) //player.iceblock.alpha = ICE_MIN_ALPHA + (ICE_MAX_ALPHA - ICE_MIN_ALPHA) * (player.freezetag_frozen_timeout - time) / (player.freezetag_frozen_timeout - player.freezetag_frozen_time); @@ -537,7 +537,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) if(n == -1) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, autocvar_g_freezetag_frozen_maxtime); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, autocvar_g_freezetag_frozen_maxtime); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, autocvar_g_freezetag_frozen_maxtime); return true; } @@ -550,7 +550,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname); Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname); } FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, LAMBDA( diff --git a/qcsrc/server/mutators/mutator/gamemode_invasion.qc b/qcsrc/server/mutators/mutator/gamemode_invasion.qc index c7cd48e8ee..7c949d8663 100644 --- a/qcsrc/server/mutators/mutator/gamemode_invasion.qc +++ b/qcsrc/server/mutators/mutator/gamemode_invasion.qc @@ -104,7 +104,7 @@ float invasion_PickMonster(float supermonster_count) if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || ((mon.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1)) continue; // flying/swimming monsters not yet supported - RandomSelection_Add(world, i, string_null, 1, 1); + RandomSelection_Add(NULL, i, string_null, 1, 1); } return RandomSelection_chosen_float; @@ -116,7 +116,7 @@ entity invasion_PickSpawn() RandomSelection_Init(); - for(e = world;(e = find(e, classname, "invasion_spawnpoint")); ) + for(e = NULL;(e = find(e, classname, "invasion_spawnpoint")); ) { RandomSelection_Add(e, 0, string_null, 1, ((time >= e.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating e.spawnshieldtime = time + autocvar_g_invasion_spawnpoint_spawn_delay; @@ -131,14 +131,14 @@ void invasion_SpawnChosenMonster(float mon) spawn_point = invasion_PickSpawn(); - if(spawn_point == world) + if(spawn_point == NULL) { LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n"); entity e = spawn(); setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs); if(MoveToRandomMapLocation(e, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256)) - monster = spawnmonster("", mon, world, world, e.origin, false, false, 2); + monster = spawnmonster("", mon, NULL, NULL, e.origin, false, false, 2); else return; setthink(e, SUB_Remove); @@ -157,10 +157,10 @@ void invasion_SpawnChosenMonster(float mon) else { RandomSelection_Init(); - if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(world, NUM_TEAM_1, string_null, 1, 1); - if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(world, NUM_TEAM_2, string_null, 1, 1); - if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(world, NUM_TEAM_3, string_null, 1, 1); } - if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(world, NUM_TEAM_4, string_null, 1, 1); } + if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(NULL, NUM_TEAM_1, string_null, 1, 1); + if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(NULL, NUM_TEAM_2, string_null, 1, 1); + if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(NULL, NUM_TEAM_3, string_null, 1, 1); } + if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(NULL, NUM_TEAM_4, string_null, 1, 1); } monster.team = RandomSelection_chosen_float; } @@ -197,8 +197,8 @@ float Invasion_CheckWinner() { FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA(Monster_Remove(it))); - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER); round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit); return 1; } @@ -245,7 +245,7 @@ float Invasion_CheckWinner() else if(inv_numkilled < inv_maxspawned) return 0; - entity winner = world; + entity winner = NULL; float winning_score = 0, winner_team = 0; @@ -280,14 +280,14 @@ float Invasion_CheckWinner() { if(winner_team) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN)); } } else if(winner) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, winner.netname); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_PLAYER_WIN, winner.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, winner.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_PLAYER_WIN, winner.netname); } round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit); @@ -368,7 +368,7 @@ MUTATOR_HOOKFUNCTION(inv, MonsterSpawn) mon.monster_skill = inv_monsterskill; if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER) - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name); mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP; } @@ -483,7 +483,7 @@ MUTATOR_HOOKFUNCTION(inv, AllowMobButcher) void invasion_ScoreRules(float inv_teams) { - if(inv_teams) { CheckAllowedTeams(world); } + if(inv_teams) { CheckAllowedTeams(NULL); } ScoreRules_basics(inv_teams, 0, 0, false); if(inv_teams) ScoreInfo_SetLabel_TeamScore(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY)); @@ -529,7 +529,7 @@ void invasion_Initialize() } } - InitializeEntity(world, invasion_DelayedInit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, invasion_DelayedInit, INITPRIO_GAMETYPE); } #endif diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index 3264c7b2cd..454e2f168f 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -78,7 +78,7 @@ bool ka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) - GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); + GameLogEcho(strcat(":ka:", mode, ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : ""))); } void ka_TouchEvent(entity this); @@ -107,7 +107,7 @@ void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1); Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1); - WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', world, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); + WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); WaypointSprite_Ping(this.waypointsprite_attachedforcarrier); sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) @@ -166,7 +166,7 @@ void ka_TouchEvent(entity this) // runs any time that the ball comes in contact // messages and sounds ka_EventLog("pickup", other); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname); Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname); Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF); sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) @@ -190,7 +190,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los if(!ball) { return; } // reset the ball - setattachment(ball, world, ""); + setattachment(ball, NULL, ""); ball.movetype = MOVETYPE_BOUNCE; ball.wait = time + 1; settouch(ball, ka_TouchEvent); @@ -201,7 +201,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los setorigin(ball, plyr.origin + '0 0 10'); ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom(); ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P - ball.owner = world; + ball.owner = NULL; // reset the player effects plyr.glow_trail = false; @@ -209,15 +209,15 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los // messages and sounds ka_EventLog("dropped", plyr); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname); - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname); sound(other, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere) // scoring // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless. // waypoints - WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); + WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT); WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier); WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier); @@ -497,7 +497,7 @@ void ka_SpawnBall() // loads various values for the ball, runs only once at star e.pushable = true; e.reset = ka_Reset; settouch(e, ka_TouchEvent); - e.owner = world; + e.owner = NULL; ka_ball = e; InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So. diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 6bb53b7c59..448a2bbc78 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -200,7 +200,7 @@ void kh_update_state() if(key.owner) key.owner.kh_state |= pow(32, key.count) * 31; } - //print(ftos((nextent(world)).kh_state), "\n"); + //print(ftos((nextent(NULL)).kh_state), "\n"); } @@ -336,12 +336,12 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs setorigin(first, first.origin + 0.5 * KH_PLAYER_ATTACHMENT_DIST); } // in any case: - setattachment(key, world, ""); + setattachment(key, NULL, ""); setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z)); key.angles = key.owner.angles; #else setorigin(key, key.owner.origin + key.origin.z * '0 0 1'); - setattachment(key, world, ""); + setattachment(key, NULL, ""); key.angles_y += key.owner.angles.y; #endif key.flags = FL_ITEM; @@ -373,10 +373,10 @@ void kh_Key_AssignTo(entity key, entity player) // runs every time a key is pic if(key.kh_next) key.kh_next.kh_prev = key.kh_prev; key.kh_prev.kh_next = key.kh_next; - key.kh_next = world; - key.kh_prev = world; + key.kh_next = NULL; + key.kh_prev = NULL; - if(key.owner.kh_next == world) + if(key.owner.kh_next == NULL) { // No longer a key carrier if(!kh_no_radar_circles) @@ -410,7 +410,7 @@ void kh_Key_AssignTo(entity key, entity player) // runs every time a key is pic kh_Key_Attach(key); - if(key.kh_next == world) + if(key.kh_next == NULL) { // player is now a key carrier entity wp = WaypointSprite_AttachCarrier(WP_Null, player, RADARICON_FLAGCARRIER); @@ -433,7 +433,7 @@ void kh_Key_AssignTo(entity key, entity player) // runs every time a key is pic // moved that here, also update if there's no player kh_update_state(); - key.pusher = world; + key.pusher = NULL; ownerteam = kh_Key_AllOwnedByWhichTeam(); if(ownerteam != ownerteam0) @@ -500,7 +500,7 @@ void kh_Key_Collect(entity key, entity player) //a player picks up a dropped ke PlayerScore_Add(player, SP_KH_PICKUPS, 1); } key.kh_dropperteam = 0; - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_PICKUP), player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_PICKUP), player.netname); kh_Key_AssignTo(key, player); // this also updates .kh_state } @@ -535,7 +535,7 @@ void kh_Key_Remove(entity key) // runs after when all the keys have been collec { entity o; o = key.owner; - kh_Key_AssignTo(key, world); + kh_Key_AssignTo(key, NULL); if(o) // it was attached WaypointSprite_Kill(key.waypointsprite_attachedforcarrier); else // it was dropped @@ -574,7 +574,7 @@ void kh_FinishRound() // runs when a team captures the keys kh_Key_Remove(key); kh_no_radar_circles = false; - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round); kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound); } @@ -609,7 +609,7 @@ void kh_WinnerTeam(float teem) // runs when a team wins // Samual: Teem?.... TE first = false; } - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(teem, INFO_KEYHUNT_CAPTURE), keyowner); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(teem, INFO_KEYHUNT_CAPTURE), keyowner); first = true; midpoint = '0 0 0'; @@ -624,7 +624,7 @@ void kh_WinnerTeam(float teem) // runs when a team wins // Samual: Teem?.... TE midpoint += thisorigin; if(!first) - te_lightning2(world, lastorigin, thisorigin); + te_lightning2(NULL, lastorigin, thisorigin); lastorigin = thisorigin; if(first) firstorigin = thisorigin; @@ -632,7 +632,7 @@ void kh_WinnerTeam(float teem) // runs when a team wins // Samual: Teem?.... TE } if(kh_teams > 2) { - te_lightning2(world, lastorigin, firstorigin); + te_lightning2(NULL, lastorigin, firstorigin); } midpoint = midpoint * (1 / kh_teams); te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component @@ -648,7 +648,7 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl float keys; float f; - attacker = world; + attacker = NULL; if(lostkey.pusher) if(lostkey.pusher.team != teem) if(IS_PLAYER(lostkey.pusher)) @@ -659,9 +659,9 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl if(attacker) { if(lostkey.kh_previous_owner) - kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -autocvar_g_balance_keyhunt_score_push); + kh_Scores_Event(lostkey.kh_previous_owner, NULL, "pushed", 0, -autocvar_g_balance_keyhunt_score_push); // don't actually GIVE him the -nn points, just log - kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0); + kh_Scores_Event(attacker, NULL, "push", autocvar_g_balance_keyhunt_score_push, 0); PlayerScore_Add(attacker, SP_KH_PUSHES, 1); //centerprint(attacker, "Your push is the best!"); // does this really need to exist? } @@ -677,7 +677,7 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl ++keys; if(lostkey.kh_previous_owner) - kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed); + kh_Scores_Event(lostkey.kh_previous_owner, NULL, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed); // don't actually GIVE him the -nn points, just log if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid) @@ -689,7 +689,7 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl if(key.owner && key.team != teem) { f = DistributeEvenly_Get(of); - kh_Scores_Event(key.owner, world, "destroyed_holdingkey", f, 0); + kh_Scores_Event(key.owner, NULL, "destroyed_holdingkey", f, 0); } fragsleft = DistributeEvenly_Get(players); @@ -711,14 +711,14 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, LAMBDA( f = DistributeEvenly_Get(1); - kh_Scores_Event(it, world, "destroyed", f, 0); + kh_Scores_Event(it, NULL, "destroyed", f, 0); )); --j; } } - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(lostkey, INFO_KEYHUNT_LOST), lostkey.kh_previous_owner.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(lostkey, INFO_KEYHUNT_LOST), lostkey.kh_previous_owner.netname); play2all(SND(KH_DESTROY)); te_tarexplosion(lostkey.origin); @@ -782,7 +782,7 @@ LABEL(not_winning) void key_reset(entity this) { - kh_Key_AssignTo(this, world); + kh_Key_AssignTo(this, NULL); kh_Key_Remove(this); } @@ -833,7 +833,7 @@ void kh_Key_Spawn(entity initial_owner, float _angle, float i) // runs every ti Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM(initial_owner.team, CENTER_KEYHUNT_START)); - WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG); + WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, NULL, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG); key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player; kh_Key_AssignTo(key, initial_owner); @@ -874,12 +874,12 @@ void kh_Key_DropOne(entity key) kh_Scores_Event(player, key, "dropkey", 0, 0); PlayerScore_Add(player, SP_KH_LOSSES, 1); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_DROP), player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_DROP), player.netname); - kh_Key_AssignTo(key, world); + kh_Key_AssignTo(key, NULL); makevectors(player.v_angle); key.velocity = W_CalculateProjectileVelocity(player, player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, false); - key.pusher = world; + key.pusher = NULL; key.pushltime = time + autocvar_g_balance_keyhunt_protecttime; key.kh_dropperteam = key.team; @@ -892,7 +892,7 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies entity mypusher; if(player.kh_next) { - mypusher = world; + mypusher = NULL; if(player.pusher) if(time < player.pushltime) mypusher = player.pusher; @@ -900,8 +900,8 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies { kh_Scores_Event(player, key, "losekey", 0, 0); PlayerScore_Add(player, SP_KH_LOSSES, 1); - Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_LOST), player.netname); - kh_Key_AssignTo(key, world); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_LOST), player.netname); + kh_Key_AssignTo(key, NULL); makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random()); key.velocity = W_CalculateProjectileVelocity(player, player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, false); key.pusher = mypusher; @@ -944,9 +944,9 @@ void kh_WaitForPlayers() // delay start of the round until enough players are p if(KH_READY_TEAMS_OK()) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round); kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound); } else @@ -954,7 +954,7 @@ void kh_WaitForPlayers() // delay start of the round until enough players are p if(player_count == 0) { if(prev_missing_teams_mask > 0) - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; } else @@ -964,7 +964,7 @@ void kh_WaitForPlayers() // delay start of the round until enough players are p if(kh_teams >= 4) missing_teams_mask += boolean(p4) * 8; if(prev_missing_teams_mask != missing_teams_mask) { - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); prev_missing_teams_mask = missing_teams_mask; } } @@ -974,8 +974,8 @@ void kh_WaitForPlayers() // delay start of the round until enough players are p void kh_EnableTrackingDevice() // runs after each round { - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT); - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT_OTHER); kh_tracking_enabled = true; } @@ -997,14 +997,14 @@ void kh_StartRound() // runs at the start of each round return; } - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT); - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT); + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT_OTHER); for(i = 0; i < kh_teams; ++i) { teem = kh_Team_ByID(i); players = 0; - entity my_player = world; + entity my_player = NULL; FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem) { @@ -1017,7 +1017,7 @@ void kh_StartRound() // runs at the start of each round } kh_tracking_enabled = false; - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking); + Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking); kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, kh_EnableTrackingDevice); } @@ -1033,7 +1033,7 @@ float kh_HandleFrags(entity attacker, entity targ, float f) // adds to the play entity k; float nk; nk = 0; - for(k = targ.kh_next; k != world; k = k.kh_next) + for(k = targ.kh_next; k != NULL; k = k.kh_next) ++nk; kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * autocvar_g_balance_keyhunt_score_collect, 0); } @@ -1086,7 +1086,7 @@ void kh_finalize() // to be called before intermission kh_FinishRound(); remove(kh_controller); - kh_controller = world; + kh_controller = NULL; } // legacy bot role diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index 557b48a909..adfd6eb6a7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -86,7 +86,7 @@ int WinningCondition_LMS() int l = LMS_NewPlayerLives(); - head = find(world, classname, STR_PLAYER); + head = find(NULL, classname, STR_PLAYER); if(head) have_player = true; head2 = find(head, classname, STR_PLAYER); @@ -194,9 +194,9 @@ void lms_RemovePlayer(entity player) if(player.killcount != FRAGS_SPECTATOR) if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2) - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname); else - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, player.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname); } MUTATOR_HOOKFUNCTION(lms, ClientDisconnect) diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index d1fa685f7a..132eba1620 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -57,7 +57,7 @@ void havocbot_role_race(entity this) this.bot_strategytime = time + autocvar_bot_ai_strategyinterval; navigation_goalrating_start(this); - for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; ) + for(e = NULL; (e = find(e, classname, "trigger_race_checkpoint")) != NULL; ) { if(e.cnt == this.race_checkpoint) { @@ -99,7 +99,7 @@ void race_ScoreRules() void race_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later { if(autocvar_sv_eventlog) - GameLogEcho(strcat(":race:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); + GameLogEcho(strcat(":race:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : ""))); } float WinningCondition_Race(float fraglimit) @@ -216,7 +216,7 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global) { float s; - Score_NicePrint(world); + Score_NicePrint(NULL); race_ClearRecords(); PlayerScore_Sort(race_place, 0, 1, 0); diff --git a/qcsrc/server/mutators/mutator/gamemode_tdm.qc b/qcsrc/server/mutators/mutator/gamemode_tdm.qc index d245721cb8..7874129085 100644 --- a/qcsrc/server/mutators/mutator/gamemode_tdm.qc +++ b/qcsrc/server/mutators/mutator/gamemode_tdm.qc @@ -13,7 +13,7 @@ REGISTER_MUTATOR(tdm, false) { if (time > 1) // game loads at time 1 error("This is a game type and it cannot be added at runtime."); - InitializeEntity(world, tdm_DelayedInit, INITPRIO_GAMETYPE); + InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE); ActivateTeamplay(); SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, autocvar_timelimit_override, -1); @@ -70,7 +70,7 @@ void tdm_SpawnTeam (string teamname, float teamcolor) void tdm_DelayedInit(entity this) { // if no teams are found, spawn defaults - if(find(world, classname, "tdm_team") == world) + if(find(NULL, classname, "tdm_team") == NULL) { LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.\n"); diff --git a/qcsrc/server/pathlib/main.qc b/qcsrc/server/pathlib/main.qc index 195e2a55e8..b6e1350789 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -231,7 +231,7 @@ entity pathlib_getbestopen() node = findchainentity(owner,openlist); if(!node) - return world; + return NULL; bestnode = node; while(node) @@ -256,7 +256,7 @@ void pathlib_close_node(entity node,vector goal) } if(node == best_open_node) - best_open_node = world; + best_open_node = NULL; ++pathlib_closed_cnt; --pathlib_open_cnt; @@ -278,13 +278,13 @@ void pathlib_close_node(entity node,vector goal) void pathlib_cleanup() { - best_open_node = world; + best_open_node = NULL; //return; entity node; - node = findfloat(world,is_path_node, true); + node = findfloat(NULL,is_path_node, true); while(node) { /* @@ -292,7 +292,7 @@ void pathlib_cleanup() node.pathlib_node_g = 0; node.pathlib_node_h = 0; node.pathlib_node_f = 0; - node.path_prev = world; + node.path_prev = NULL; */ dumpnode(node); @@ -305,8 +305,8 @@ void pathlib_cleanup() if(closedlist) remove(closedlist); - openlist = world; - closedlist = world; + openlist = NULL; + closedlist = NULL; } @@ -468,7 +468,7 @@ entity pathlib_astar(entity this, vector from,vector to) //to_z += 32; LOG_TRACE("AStar init\n"); - path = pathlib_mknode(from, world); + path = pathlib_mknode(from, NULL); pathlib_close_node(path, to); if(pathlib_foundgoal) { @@ -488,7 +488,7 @@ entity pathlib_astar(entity this, vector from,vector to) LOG_TRACE("AStar path fail.\n"); pathlib_cleanup(); - return world; + return NULL; } best_open_node = pathlib_getbestopen(); @@ -510,7 +510,7 @@ entity pathlib_astar(entity this, vector from,vector to) LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n"); pathlib_cleanup(); - return world; + return NULL; } best_open_node = pathlib_getbestopen(); @@ -528,8 +528,8 @@ entity pathlib_astar(entity this, vector from,vector to) ftime = gettime(GETTIME_REALTIME); ptime = ftime - ptime; - start = path_build(world,path.origin,world,world); - end = path_build(world,goal_node.origin,world,start); + start = path_build(NULL,path.origin,NULL,NULL); + end = path_build(NULL,goal_node.origin,NULL,start); ln = end; open = goal_node; @@ -574,5 +574,5 @@ entity pathlib_astar(entity this, vector from,vector to) pathlib_cleanup(); - return world; + return NULL; } diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index f86c270b04..35dcce5b25 100644 --- a/qcsrc/server/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -14,7 +14,7 @@ void pathlib_wpp_close(entity wp) wp.pathlib_list = closedlist; if(wp == best_open_node) - best_open_node = world; + best_open_node = NULL; if(wp == goal_node) pathlib_foundgoal = true; @@ -170,7 +170,7 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) // FIXME! presisted chain for better preformance for(n = findchain(classname, "waypoint"); n; n = n.chain) { - n.pathlib_list = world; + n.pathlib_list = NULL; n.pathlib_node_g = 0; n.pathlib_node_f = 0; n.pathlib_node_h = 0; @@ -190,10 +190,10 @@ entity pathlib_waypointpath(entity wp_from, entity wp_to, float callback) if(pathlib_open_cnt <= 0) { LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.\n"); - return world; + return NULL; } - return world; + return NULL; } entity pathlib_waypointpath_step() @@ -204,7 +204,7 @@ entity pathlib_waypointpath_step() if(!n) { LOG_TRACE("Cannot find best open node, abort.\n"); - return world; + return NULL; } pathlib_wpp_close(n); LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links\n"); @@ -216,8 +216,8 @@ entity pathlib_waypointpath_step() LOG_TRACE("Target found. Rebuilding and filtering path...\n"); buildpath_nodefilter = buildpath_nodefilter_none; - start = path_build(world, start_node.origin, world, world); - end = path_build(world, goal_node.origin, world, start); + start = path_build(NULL, start_node.origin, NULL, NULL); + end = path_build(NULL, goal_node.origin, NULL, start); ln = end; for(open = goal_node; open.path_prev != start_node; open = open.path_prev) @@ -232,7 +232,7 @@ entity pathlib_waypointpath_step() return start; } - return world; + return NULL; } void plas_think(entity this) { diff --git a/qcsrc/server/pathlib/utility.qc b/qcsrc/server/pathlib/utility.qc index 979b227b20..77f5330ef7 100644 --- a/qcsrc/server/pathlib/utility.qc +++ b/qcsrc/server/pathlib/utility.qc @@ -68,7 +68,7 @@ entity pathlib_nodeatpoint(vector where) node = node.chain; } - return world; + return NULL; } float tile_check_cross(entity this, vector where) diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index 9c4b08647d..f6502dfd81 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -369,8 +369,8 @@ void Portal_MakeOutPortal(entity portal) void Portal_Disconnect(entity teleporter, entity destination) { - teleporter.enemy = world; - destination.enemy = world; + teleporter.enemy = NULL; + destination.enemy = NULL; Portal_MakeBrokenPortal(teleporter); Portal_MakeBrokenPortal(destination); } @@ -407,10 +407,10 @@ void Portal_Remove(entity portal, float killed) } if(portal == portal.aiment.portal_in) - portal.aiment.portal_in = world; + portal.aiment.portal_in = NULL; if(portal == portal.aiment.portal_out) - portal.aiment.portal_out = world; - //portal.aiment = world; + portal.aiment.portal_out = NULL; + //portal.aiment = NULL; // makes the portal vanish if(killed) @@ -467,7 +467,7 @@ void Portal_Think(entity this) o = this.aiment; this.solid = SOLID_BBOX; - this.aiment = world; + this.aiment = NULL; g = frametime * '0 0 -1' * autocvar_sv_gravity; @@ -621,7 +621,7 @@ entity Portal_Spawn(entity own, vector org, vector ang) fixedmakevectors(ang); if(!CheckWireframeBox(own, org - 48 * v_right - 48 * v_up + 16 * v_forward, 96 * v_right, 96 * v_up, 96 * v_forward)) - return world; + return NULL; portal = new(portal); portal.aiment = own; @@ -643,7 +643,7 @@ entity Portal_Spawn(entity own, vector org, vector ang) if(!Portal_FindSafeOrigin(portal)) { remove(portal); - return world; + return NULL; } setsize(portal, '-48 -48 -48', '48 48 48'); diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index f729137a61..c4e94cd13d 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -264,7 +264,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) { oldrec = race_readTime(GetMapname(), player_prevpos); race_SendStatus(0, e); // "fail" - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FAIL_RANKED, mynetname, player_prevpos, t, oldrec); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FAIL_RANKED, mynetname, player_prevpos, t, oldrec); return; } else if (!newpos) @@ -272,7 +272,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) // no ranking, time worse than the worst ranked oldrec = race_readTime(GetMapname(), RANKINGS_CNT); race_SendStatus(0, e); // "fail" - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FAIL_UNRANKED, mynetname, RANKINGS_CNT, t, oldrec); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FAIL_UNRANKED, mynetname, RANKINGS_CNT, t, oldrec); return; } @@ -281,7 +281,7 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) // if the player does not have a UID we can unfortunately not store the record, as the rankings system relies on UIDs if(myuid == "") { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_MISSING_UID, mynetname, t); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_MISSING_UID, mynetname, t); return; } @@ -304,19 +304,19 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) if(newpos == player_prevpos) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec); if(newpos == 1) { race_SendStatus(3, e); } // "new server record" else { race_SendStatus(1, e); } // "new time" } else if(oldrec == 0) { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_SET, mynetname, newpos, t); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_SET, mynetname, newpos, t); if(newpos == 1) { race_SendStatus(3, e); } // "new server record" else { race_SendStatus(2, e); } // "new rank" } else { - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_BROKEN, mynetname, oldrec_holder, newpos, t, oldrec); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_BROKEN, mynetname, oldrec_holder, newpos, t, oldrec); if(newpos == 1) { race_SendStatus(3, e); } // "new server record" else { race_SendStatus(2, e); } // "new rank" } @@ -394,7 +394,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid) { e.race_completed = 1; MAKE_INDEPENDENT_PLAYER(e); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FINISHED, e.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FINISHED, e.netname); ClientData_Touch(e); } } @@ -525,7 +525,7 @@ void race_ClearTime(entity e) e.race_laptime = 0; e.race_movetime = e.race_movetime_frac = e.race_movetime_count = 0; e.race_penalty_accumulator = 0; - e.race_lastpenalty = world; + e.race_lastpenalty = NULL; if(!IS_REAL_CLIENT(e)) return; @@ -604,18 +604,18 @@ void checkpoint_passed(entity this, entity player) float largest_cp_id = 0; float cp_amount = 0; - for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) + for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) { cp_amount += 1; if(cp.race_checkpoint > largest_cp_id) // update the finish id if someone hit a new checkpoint { largest_cp_id = cp.race_checkpoint; - for(cp = world; (cp = find(cp, classname, "target_stopTimer"));) + for(cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) cp.race_checkpoint = largest_cp_id + 1; // finish line race_highest_checkpoint = largest_cp_id + 1; race_timed_checkpoint = largest_cp_id + 1; - for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) + for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) { if(cp.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes defragcpexists = -1; @@ -624,7 +624,7 @@ void checkpoint_passed(entity this, entity player) } if(cp_amount == 0) { - for(cp = world; (cp = find(cp, classname, "target_stopTimer"));) + for(cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) cp.race_checkpoint = 1; race_highest_checkpoint = 1; race_timed_checkpoint = 1; @@ -669,7 +669,7 @@ void checkpoint_passed(entity this, entity player) player.race_laptime = time; player.race_movetime = player.race_movetime_frac = player.race_movetime_count = 0; player.race_penalty_accumulator = 0; - player.race_lastpenalty = world; + player.race_lastpenalty = NULL; } if(g_race_qualifying) @@ -681,7 +681,7 @@ void checkpoint_passed(entity this, entity player) defragcpexists = fh = fopen(strcat("maps/", GetMapname(), ".defragcp"), FILE_WRITE); if(fh >= 0) { - for(cp = world; (cp = find(cp, classname, "target_checkpoint"));) + for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) fputs(fh, strcat(cp.targetname, " ", ftos(cp.race_checkpoint), "\n")); } fclose(fh); @@ -788,7 +788,7 @@ void trigger_race_checkpoint_verify(entity this) defragcpexists = -1; // something's wrong in the defrag cp file, set defragcpexists to -1 so that it will be rewritten when someone finishes continue; } - for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) { if (argv(0) == cp.targetname) { cp.race_checkpoint = stof(argv(1)); } @@ -802,38 +802,38 @@ void trigger_race_checkpoint_verify(entity this) if (race_timed_checkpoint) { if (defrag_ents) { - for (entity cp = world; (cp = find(cp, classname, "target_startTimer"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_startTimer"));) { WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null); } - for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) { WaypointSprite_UpdateSprites(cp.sprite, WP_RaceFinish, WP_Null, WP_Null); } - for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) { if (cp.race_checkpoint == -2) { // something's wrong with the defrag cp file or it has not been written yet, set defragcpexists to -1 so that it will be rewritten when someone finishes defragcpexists = -1; } } if (defragcpexists != -1) { float largest_cp_id = 0; - for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) { if (cp.race_checkpoint > largest_cp_id) { largest_cp_id = cp.race_checkpoint; } } - for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) { cp.race_checkpoint = largest_cp_id + 1; // finish line } race_highest_checkpoint = largest_cp_id + 1; race_timed_checkpoint = largest_cp_id + 1; } else { - for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) { + for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) { cp.race_checkpoint = 255; // finish line } race_highest_checkpoint = 255; race_timed_checkpoint = 255; } } else { - for (entity cp = world; (cp = find(cp, classname, "trigger_race_checkpoint")); ) { + for (entity cp = NULL; (cp = find(cp, classname, "trigger_race_checkpoint")); ) { if (cp.sprite) { if (cp.race_checkpoint == 0) { WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null); @@ -846,8 +846,8 @@ void trigger_race_checkpoint_verify(entity this) } if (defrag_ents) { - for (entity trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); ) { - for (entity targ = world; (targ = find(targ, targetname, trigger.target)); ) { + for (entity trigger = NULL; (trigger = find(trigger, classname, "trigger_multiple")); ) { + for (entity targ = NULL; (targ = find(targ, targetname, trigger.target)); ) { if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer") { trigger.wait = 0; trigger.delay = 0; @@ -1000,7 +1000,7 @@ void race_AbandonRaceCheck(entity p) { p.race_completed = 1; MAKE_INDEPENDENT_PLAYER(p); - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_ABANDONED, p.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_ABANDONED, p.netname); ClientData_Touch(p); } } @@ -1017,7 +1017,7 @@ void race_PreparePlayer(entity this) this.race_place = 0; this.race_started = 0; this.race_respawn_checkpoint = 0; - this.race_respawn_spotref = world; + this.race_respawn_spotref = NULL; } void race_RetractPlayer(entity this) @@ -1154,7 +1154,7 @@ float race_GetFractionalLapCount(entity e) return l; // finish bestfraction = 1; - for(cp0 = world; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); ) + for(cp0 = NULL; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); ) { if(cp0.race_checkpoint != lastcpindex) continue; @@ -1162,7 +1162,7 @@ float race_GetFractionalLapCount(entity e) if(cp0 != lastcp) continue; o0 = (cp0.absmin + cp0.absmax) * 0.5; - for(cp1 = world; (cp1 = find(cp1, classname, "trigger_race_checkpoint")); ) + for(cp1 = NULL; (cp1 = find(cp1, classname, "trigger_race_checkpoint")); ) { if(cp1.race_checkpoint != nextcpindex) continue; diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index ad0fcaae66..d1302a84d7 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -112,5 +112,5 @@ void round_handler_Reset(float next_think) void round_handler_Remove() { remove(round_handler); - round_handler = world; + round_handler = NULL; } diff --git a/qcsrc/server/round_handler.qh b/qcsrc/server/round_handler.qh index 7d4499ce4a..e6b17b0e77 100644 --- a/qcsrc/server/round_handler.qh +++ b/qcsrc/server/round_handler.qh @@ -17,7 +17,7 @@ void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, v void round_handler_Reset(float next_think); void round_handler_Remove(); -#define round_handler_IsActive() (round_handler != world) +#define round_handler_IsActive() (round_handler != NULL) #define round_handler_AwaitingNextRound() (round_handler.wait) #define round_handler_CountdownRunning() (!round_handler.wait && round_handler.cnt) #define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt) diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 8be145b016..aa108dd985 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -328,7 +328,7 @@ void PlayerScore_Detach(entity player) if(!player.scorekeeper) error("player has no scorekeeper"); remove(player.scorekeeper); - player.scorekeeper = world; + player.scorekeeper = NULL; } float PlayerScore_Add(entity player, float scorefield, float score) @@ -405,10 +405,10 @@ void WinningConditionHelper(entity this) s = GetGametype(); s = strcat(s, ":", autocvar_g_xonoticversion); s = strcat(s, ":P", ftos(cvar_purechanges_count)); - s = strcat(s, ":S", ftos(nJoinAllowed(this, world))); + s = strcat(s, ":S", ftos(nJoinAllowed(this, NULL))); s = strcat(s, ":F", ftos(serverflags)); s = strcat(s, ":M", modname); - s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2))); + s = strcat(s, "::", GetPlayerScoreString(NULL, (fullstatus ? 1 : 2))); if(teamscores_entities_count) { @@ -421,8 +421,8 @@ void WinningConditionHelper(entity this) WinningConditionHelper_winnerteam = -1; WinningConditionHelper_secondteam = -1; - winnerscorekeeper = world; - secondscorekeeper = world; + winnerscorekeeper = NULL; + secondscorekeeper = NULL; for(t = 0; t < 16; ++t) { sk = teamscorekeepers[t]; @@ -454,15 +454,15 @@ void WinningConditionHelper(entity this) WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER); WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST); - WinningConditionHelper_winner = world; // not supported in teamplay - WinningConditionHelper_second = world; // not supported in teamplay + WinningConditionHelper_winner = NULL; // not supported in teamplay + WinningConditionHelper_second = NULL; // not supported in teamplay } else { - WinningConditionHelper_winner = world; - WinningConditionHelper_second = world; - winnerscorekeeper = world; - secondscorekeeper = world; + WinningConditionHelper_winner = NULL; + WinningConditionHelper_second = NULL; + winnerscorekeeper = NULL; + secondscorekeeper = NULL; FOREACH_CLIENT(IS_PLAYER(it), LAMBDA( sk = it.scorekeeper; c = PlayerScore_Compare(winnerscorekeeper, sk, 1); @@ -486,7 +486,7 @@ void WinningConditionHelper(entity this) WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0); if(WinningConditionHelper_equality) - WinningConditionHelper_winner = WinningConditionHelper_second = world; + WinningConditionHelper_winner = WinningConditionHelper_second = NULL; WinningConditionHelper_topscore = winnerscorekeeper.scores_primary; WinningConditionHelper_secondscore = secondscorekeeper.scores_primary; @@ -695,7 +695,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat entity p, plist, pprev, pbest, pbestprev, pfirst, plast; float i, j; - plist = world; + plist = NULL; FOREACH_CLIENT(true, LAMBDA(it.(field) = 0)); @@ -710,12 +710,12 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat }); // Now plist points to the whole list. - pfirst = plast = world; + pfirst = plast = NULL; i = j = 0; while(plist) { - pprev = pbestprev = world; + pprev = pbestprev = NULL; pbest = plist; for(p = plist; (pprev = p), (p = p.chain); ) { @@ -727,11 +727,11 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat } // remove pbest out of the chain - if(pbestprev == world) + if(pbestprev == NULL) plist = pbest.chain; else pbestprev.chain = pbest.chain; - pbest.chain = world; + pbest.chain = NULL; ++i; if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0)) diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index eb014e44e3..a462bde92c 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -2,7 +2,7 @@ #include -entity scores_initialized; // non-world when scores labels/rules have been set +entity scores_initialized; // non-NULL when scores labels/rules have been set .float scores[MAX_SCORE]; .float teamscores[MAX_TEAMSCORE]; .float scoreboard_pos; @@ -99,15 +99,15 @@ float WinningConditionHelper_secondscore; ///< second highest score float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none float WinningConditionHelper_secondteam; ///< the color of the second team, or -1 if none float WinningConditionHelper_equality; ///< we have no winner -entity WinningConditionHelper_winner; ///< the winning player, or world if none -entity WinningConditionHelper_second; ///< the second player, or world if none +entity WinningConditionHelper_winner; ///< the winning player, or NULL if none +entity WinningConditionHelper_second; ///< the second player, or NULL if none float WinningConditionHelper_lowerisbetter; ///< lower is better, duh float WinningConditionHelper_zeroisworst; ///< zero is worst, duh #define WINNINGCONDITIONHELPER_LOWERISBETTER_WORST 999999999 /** * Returns score strings for eventlog etc. - * When called with world, or 0, as argument, they return the labels in the + * When called with NULL, or 0, as argument, they return the labels in the * same order. * The strings are comma separated; labels that end with !! designate primary, * labels that end with ! designate high priority. diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 80836bcb35..72eeb9a1cc 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -43,7 +43,7 @@ void ScoreRules_generic() { if(teamplay) { - CheckAllowedTeams(world); + CheckAllowedTeams(NULL); ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); } else diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index c71ce1d312..f55fb1122a 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -254,7 +254,7 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck) float found; found = 0; - for(ent = world; (ent = find(ent, targetname, spot.target)); ) + for(ent = NULL; (ent = find(ent, targetname, spot.target)); ) { ++found; if(ent.spawn_evalfunc) @@ -288,8 +288,8 @@ entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, flo { entity spot, spotlist, spotlistend; - spotlist = world; - spotlistend = world; + spotlist = NULL; + spotlistend = NULL; Spawn_ScoreAll(this, firstspot, mindist, teamcheck); @@ -305,7 +305,7 @@ entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, flo } } if(spotlistend) - spotlistend.chain = world; + spotlistend.chain = NULL; return spotlist; } @@ -335,7 +335,7 @@ entity SelectSpawnPoint(entity this, bool anypoint) float teamcheck; entity spot, firstspot; - spot = find (world, classname, "testplayerstart"); + spot = find (NULL, classname, "testplayerstart"); if (spot) return spot; @@ -392,7 +392,7 @@ entity SelectSpawnPoint(entity this, bool anypoint) else { if(some_spawn_has_been_used) - return world; // team can't spawn any more, because of actions of other team + return NULL; // team can't spawn any more, because of actions of other team else error("Cannot find a spawn point - please fix the map!"); } diff --git a/qcsrc/server/steerlib.qc b/qcsrc/server/steerlib.qc index 0c8c8fdc96..bf0a955515 100644 --- a/qcsrc/server/steerlib.qc +++ b/qcsrc/server/steerlib.qc @@ -275,25 +275,25 @@ vector steerlib_traceavoid(entity this, float pitch,float length) traceline(this.origin, this.origin + vup_left,MOVE_NOMONSTERS,this); fup_left = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); vup_right = (v_forward + (v_right * pitch + v_up * pitch)) * length; traceline(this.origin,this.origin + vup_right ,MOVE_NOMONSTERS,this); fup_right = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); vdown_left = (v_forward + (v_left * pitch + v_down * pitch)) * length; traceline(this.origin,this.origin + vdown_left,MOVE_NOMONSTERS,this); fdown_left = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); vdown_right = (v_forward + (v_right * pitch + v_down * pitch)) * length; traceline(this.origin,this.origin + vdown_right,MOVE_NOMONSTERS,this); fdown_right = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); upwish = v_up * (fup_left + fup_right); downwish = v_down * (fdown_left + fdown_right); leftwish = v_left * (fup_left + fdown_left); @@ -324,13 +324,13 @@ vector steerlib_traceavoid_flat(entity this, float pitch, float length, vector v traceline(this.origin + vofs, this.origin + vofs + vt_left,MOVE_NOMONSTERS,this); f_left = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); vt_right = (v_forward + (v_right * pitch)) * length; traceline(this.origin + vofs, this.origin + vofs + vt_right ,MOVE_NOMONSTERS,this); f_right = trace_fraction; - //te_lightning1(world,this.origin, trace_endpos); + //te_lightning1(NULL,this.origin, trace_endpos); leftwish = v_left * f_left; rightwish = v_right * f_right; @@ -410,8 +410,8 @@ float beamsweep(entity this, vector from, vector dir,float length, float step,fl if(beamsweep_badpoint(trace_endpos,0)) return i / length; #ifdef BEAMSTEER_VISUAL - te_lightning1(world,a+u,b+u); - te_lightning1(world,b+u,b-d); + te_lightning1(NULL,a+u,b+u); + te_lightning1(NULL,b+u,b-d); #endif a = trace_endpos; } @@ -497,7 +497,7 @@ void flocker_die(entity this) Send_Effect(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1); this.owner.cnt += 1; - this.owner = world; + this.owner = NULL; this.nextthink = time; setthink(this, SUB_Remove); @@ -591,7 +591,7 @@ void flocker_hunter_think(entity this) { ee = this.enemy; ee.health = -1; - this.enemy = world; + this.enemy = NULL; } diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index c842dac3f9..aac9c497d1 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -38,9 +38,9 @@ void CreatureFrame_hotliquids(entity this) if (this.flags & FL_PROJECTILE) { if (this.watertype == CONTENT_LAVA) - Damage (this, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0'); else if (this.watertype == CONTENT_SLIME) - Damage (this, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0'); } else { @@ -51,9 +51,9 @@ void CreatureFrame_hotliquids(entity this) this.watersound_finished = time + 0.5; sound (this, CH_PLAYER_SINGLE, SND_LAVA, VOL_BASE, ATTEN_NORM); } - Damage (this, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0'); if(autocvar_g_balance_contents_playerdamage_lava_burn) - Fire_AddDamage(this, world, autocvar_g_balance_contents_playerdamage_lava_burn * this.waterlevel, autocvar_g_balance_contents_playerdamage_lava_burn_time * this.waterlevel, DEATH_LAVA.m_id); + Fire_AddDamage(this, NULL, autocvar_g_balance_contents_playerdamage_lava_burn * this.waterlevel, autocvar_g_balance_contents_playerdamage_lava_burn_time * this.waterlevel, DEATH_LAVA.m_id); } else if (this.watertype == CONTENT_SLIME) { @@ -62,7 +62,7 @@ void CreatureFrame_hotliquids(entity this) this.watersound_finished = time + 0.5; sound (this, CH_PLAYER_SINGLE, SND_SLIME, VOL_BASE, ATTEN_NORM); } - Damage (this, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0'); } } } @@ -107,11 +107,11 @@ void CreatureFrame_FallDamage(entity this) else dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage); if (dm > 0) - Damage (this, world, world, dm, DEATH_FALL.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, dm, DEATH_FALL.m_id, this.origin, '0 0 0'); } if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed) - Damage (this, world, world, 100000, DEATH_SHOOTING_STAR.m_id, this.origin, '0 0 0'); + Damage (this, NULL, NULL, 100000, DEATH_SHOOTING_STAR.m_id, this.origin, '0 0 0'); } } @@ -400,7 +400,7 @@ void WarpZone_PostInitialize_Callback() { // create waypoint links for warpzones entity e; - for(e = world; (e = find(e, classname, "trigger_warpzone")); ) + for(e = NULL; (e = find(e, classname, "trigger_warpzone")); ) { vector src, dst; src = (e.absmin + e.absmax) * 0.5; diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index 4caadee238..1bdb49765d 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -71,8 +71,8 @@ spawnfunc(item_enviro) { spawnfunc_item_invincible(this); } void target_init_verify(entity this) { entity trigger, targ; - for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); ) - for(targ = world; (targ = find(targ, targetname, trigger.target)); ) + for(trigger = NULL; (trigger = find(trigger, classname, "trigger_multiple")); ) + for(targ = NULL; (targ = find(targ, targetname, trigger.target)); ) if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items") { trigger.wait = 0; @@ -98,7 +98,7 @@ spawnfunc(target_init) void target_give_init(entity this) { entity targ; - for (targ = world; (targ = find(targ, targetname, this.target)); ) { + for (targ = NULL; (targ = find(targ, targetname, this.target)); ) { if (targ.classname == "weapon_rocketlauncher" || targ.classname == "weapon_devastator") { this.ammo_rockets += targ.count * WEP_CVAR(devastator, ammo); this.netname = "devastator"; diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 203396f314..8709a6aae6 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -77,7 +77,7 @@ void InitGameplayMode() cache_mutatormsg = strzone(""); cache_lastmutatormsg = strzone(""); - InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK); + InitializeEntity(NULL, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK); } string GetClientVersionMessage(entity this) @@ -230,7 +230,7 @@ void CheckAllowedTeams (entity for_whom) // find out what teams are allowed if necessary if(teament_name) { - entity head = find(world, classname, teament_name); + entity head = find(NULL, classname, teament_name); while(head) { switch(head.team) @@ -457,7 +457,7 @@ float FindSmallestTeam(entity pl, float ignore_pl) if(ignore_pl) GetTeamCounts(pl); else - GetTeamCounts(world); + GetTeamCounts(NULL); RandomSelection_Init(); @@ -471,13 +471,13 @@ float FindSmallestTeam(entity pl, float ignore_pl) // now t is the minimum, or A minimum! if(t == 1 || TeamSmallerEqThanTeam(1, t, pl)) - RandomSelection_Add(world, 1, string_null, 1, 1); + RandomSelection_Add(NULL, 1, string_null, 1, 1); if(t == 2 || TeamSmallerEqThanTeam(2, t, pl)) - RandomSelection_Add(world, 2, string_null, 1, 1); + RandomSelection_Add(NULL, 2, string_null, 1, 1); if(t == 3 || TeamSmallerEqThanTeam(3, t, pl)) - RandomSelection_Add(world, 3, string_null, 1, 1); + RandomSelection_Add(NULL, 3, string_null, 1, 1); if(t == 4 || TeamSmallerEqThanTeam(4, t, pl)) - RandomSelection_Add(world, 4, string_null, 1, 1); + RandomSelection_Add(NULL, 4, string_null, 1, 1); return RandomSelection_chosen_float; } @@ -570,7 +570,7 @@ void SV_ChangeTeam(float _color) if(!IS_CLIENT(this)) { // since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here - Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CONNECTING, this.netname); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CONNECTING, this.netname); return; } @@ -693,9 +693,9 @@ void ShufflePlayerOutOfTeam (float source_team) else // if(source_team == 4) steam = NUM_TEAM_4; - lowest_bot = world; + lowest_bot = NULL; lowest_bot_score = 999999999; - lowest_player = world; + lowest_player = NULL; lowest_player_score = 999999999; // find the lowest-scoring player & bot of that team @@ -719,7 +719,7 @@ void ShufflePlayerOutOfTeam (float source_team) )); // prefers to move a bot... - if(lowest_bot != world) + if(lowest_bot != NULL) selected = lowest_bot; // but it will move a player if it has to else diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index fe59b5bfbb..c69b8e9a9c 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -20,7 +20,7 @@ void thrown_wep_think(entity this) this.SendFlags |= ISF_LOCATION; this.oldorigin = this.origin; } - this.owner = world; + this.owner = NULL; float timeleft = this.savenextthink - time; if(timeleft > 1) SUB_SetFade(this, this.savenextthink - 1, 1); diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 531cf19aa5..5c64a0ec64 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -32,8 +32,8 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m else ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; if(antilag) - WarpZone_traceline_antilag(world, ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent)); - // passing world, because we do NOT want it to touch dphitcontentsmask + WarpZone_traceline_antilag(NULL, ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent)); + // passing NULL, because we do NOT want it to touch dphitcontentsmask else WarpZone_TraceLine(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NOMONSTERS, ent); ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; @@ -164,7 +164,7 @@ vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvel void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute) { - if(proj.owner == world) + if(proj.owner == NULL) error("Unowned missile"); dir = dir + upDir * (pUpSpeed / pSpeed); @@ -211,7 +211,7 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl entity pseudoprojectile; float f, ffs; - pseudoprojectile = world; + pseudoprojectile = NULL; dir = normalize(end - start); length = vlen(end - start); @@ -234,15 +234,15 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl WarpZone_traceline_antilag (this, start, end, false, o, ANTILAG_LATENCY(this)); if(o && WarpZone_trace_firstzone) { - o = world; + o = NULL; continue; } if(trace_ent.solid == SOLID_BSP || trace_ent.solid == SOLID_SLIDEBOX) Damage_DamageInfo(trace_endpos, bdamage, 0, 0, force, deathtype, trace_ent.species, this); - // if it is world we can't hurt it so stop now - if (trace_ent == world || trace_fraction == 1) + // if it is NULL we can't hurt it so stop now + if (trace_ent == NULL || trace_fraction == 1) break; // make the entity non-solid so we can hit the next one @@ -265,7 +265,7 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl endq3surfaceflags = trace_dphitq3surfaceflags; // find all the entities the railgun hit and restore their solid state - ent = findfloat(world, railgunhit, true); + ent = findfloat(NULL, railgunhit, true); while (ent) { // restore their solid type @@ -304,7 +304,7 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl } // find all the entities the railgun hit and hurt them - ent = findfloat(world, railgunhit, true); + ent = findfloat(NULL, railgunhit, true); while (ent) { // get the details we need to call the damage function @@ -322,7 +322,7 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl // create a small explosion to throw gibs around (if applicable) //setorigin(explosion, hitloc); - //RadiusDamage (explosion, this, 10, 0, 50, world, world, 300, deathtype); + //RadiusDamage (explosion, this, 10, 0, 50, NULL, NULL, 300, deathtype); ent.railgunhitloc = '0 0 0'; ent.railgunhitsolidbackup = SOLID_NOT; @@ -344,9 +344,9 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl void fireBullet_trace_callback(vector start, vector hit, vector end) { if(vdist(hit - start, >, 16)) - trailparticles(world, fireBullet_trace_callback_eff, start, hit); - WarpZone_trace_forent = world; - fireBullet_last_hit = world; + trailparticles(NULL, fireBullet_trace_callback_eff, start, hit); + WarpZone_trace_forent = NULL; + fireBullet_last_hit = NULL; } void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects) @@ -356,7 +356,7 @@ void fireBullet(entity this, vector start, vector dir, float spread, float max_s dir = normalize(dir + randomvec() * spread); end = start + dir * MAX_SHOT_DISTANCE; - fireBullet_last_hit = world; + fireBullet_last_hit = NULL; float solid_penetration_left = 1; float total_damage = 0; @@ -393,7 +393,7 @@ void fireBullet(entity this, vector start, vector dir, float spread, float max_s for (;;) { // TODO also show effect while tracing - WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, world, fireBullet_trace_callback); + WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, NULL, fireBullet_trace_callback); dir = WarpZone_TransformVelocity(WarpZone_trace_transform, dir); end = WarpZone_TransformOrigin(WarpZone_trace_transform, end); start = trace_endpos; diff --git a/qcsrc/server/weapons/weaponstats.qc b/qcsrc/server/weapons/weaponstats.qc index 4e5f347488..2b4be7e917 100644 --- a/qcsrc/server/weapons/weaponstats.qc +++ b/qcsrc/server/weapons/weaponstats.qc @@ -74,7 +74,7 @@ void WeaponStats_Shutdown() return; if(autocvar_sv_weaponstats_file != "") { - url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world); + url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, NULL); } else {