From: TimePath Date: Sat, 12 Mar 2016 10:43:10 +0000 (+1100) Subject: s/make_pure/new_pure/ X-Git-Tag: xonotic-v0.8.2~1118 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a5b9bade4e12be649f913a6bebb15183feba6554;p=xonotic%2Fxonotic-data.pk3dir.git s/make_pure/new_pure/ --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 8cc574518..c52b3cd56 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -315,8 +315,7 @@ void Playerchecker_Think() // player connected if (!e) { - playerslots[i] = e = new(playerslot); - make_pure(e); + playerslots[i] = e = new_pure(playerslot); } e.sv_entnum = i; e.ping = 0; @@ -337,8 +336,7 @@ void Porto_Init(); void TrueAim_Init(); void PostInit() { - entity playerchecker = new(playerchecker); - make_pure(playerchecker); + entity playerchecker = new_pure(playerchecker); playerchecker.think = Playerchecker_Think; playerchecker.nextthink = time + 0.2; @@ -434,8 +432,7 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew) o = playerslots[this.sv_entnum]; if (!o) { - o = playerslots[this.sv_entnum] = new(playerslot); - make_pure(o); + o = playerslots[this.sv_entnum] = new_pure(playerslot); } this.owner = o; o.sv_entnum = this.sv_entnum; diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 0c262604b..fd83aa2d1 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -124,8 +124,7 @@ entity GetTeam(int Team, bool add) return teamslots[num]; if (!add) return world; - entity tm = new(team); - make_pure(tm); + entity tm = new_pure(team); tm.team = Team; teamslots[num] = tm; RegisterTeam(tm); diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 826083bc1..7ed13b3e9 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -23,8 +23,7 @@ STATIC_INIT(shownames_ent) shownames_ent = LL_NEW(); for (int i = 0; i < maxclients; ++i) { - entity e = new(shownames_tag); - make_pure(e); + entity e = new_pure(shownames_tag); e.sv_entnum = i + 1; LL_PUSH(shownames_ent, e); } diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index edf56a87d..b374403db 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -338,7 +338,6 @@ void viewmodel_draw(entity this) entity viewmodel; STATIC_INIT(viewmodel) { viewmodel = new(viewmodel); - make_pure(viewmodel); } entity porto; @@ -422,8 +421,7 @@ void Porto_Draw(entity this) void Porto_Init() { - porto = new(porto); - make_pure(porto); + porto = new_pure(porto); porto.draw = Porto_Draw; porto.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; } @@ -590,12 +588,8 @@ const float SHOTTYPE_HITENEMY = 4; void TrueAim_Init() { - trueaim = new(trueaim); - make_pure(trueaim); - trueaim.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; - trueaim_rifle = new(trueaim_rifle); - make_pure(trueaim_rifle); - trueaim_rifle.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE; + (trueaim = new_pure(trueaim)).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE; + (trueaim_rifle = new_pure(trueaim_rifle)).dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE; } float EnemyHitCheck() diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index a72d3538a..2dab5a9f5 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -6,6 +6,12 @@ REGISTER_NET_TEMP(net_debug) #endif +#ifdef SVQC + +#include + +#endif + #ifdef CSQC NET_HANDLE(net_debug, bool isNew) { @@ -33,7 +39,9 @@ REGISTER_NET_TEMP(net_debug) WriteByte(channel, is_pure(this)); vector o = this.origin; if (o == '0 0 0') // brushes - o = (this.absmin + this.absmax) / 2; + o = (this.absmin + this.absmax) / 2; + if (this.tag_entity) + o += this.tag_entity.origin; WriteCoord(channel, o.x); WriteCoord(channel, o.y); WriteCoord(channel, o.z); WriteString(channel, this.classname); WriteString(channel, this.sourceLoc); @@ -83,9 +91,9 @@ bool autocvar_debugdraw; if (e.origin) continue; } if (autocvar_debugdraw == 5) - { - if (!e.debug) continue; - } + { + if (!e.debug) continue; + } else if (autocvar_debugdraw > 5) { bool flag = true; @@ -131,7 +139,10 @@ bool autocvar_debugdraw; if (autocvar_debugdraw < 2) continue; rgb.y = 1; } - vector pos = project_3d_to_2d(e.origin); + vector o = e.origin; + if (e.tag_entity) + o += e.tag_entity.origin; + vector pos = project_3d_to_2d(o); if (pos.z < 0) continue; pos.z = 0; pos.y += ofs * sz; @@ -158,7 +169,7 @@ bool autocvar_debugdraw; for (entity e = NULL; (e = findfloat(e, debug, 0)) && rem > 0; ) { if (autocvar_debugdraw < 2 && is_pure(e)) continue; - debug_send(e, nextent(NULL), 0); + debug_send(e, caller, 0); e.debug = true; --rem; } @@ -270,3 +281,48 @@ STATIC_INIT(TRACE_ENT) e.draw2d = Trace_draw2d; } #endif + +#ifdef SVQC +SERVER_COMMAND(find, "Search through entities for matching classname") +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + for (entity client = NULL; (client = find(client, classname, argv(1))); ) + LOG_INFO(etos(client), "\n"); + return; + } + + default: + LOG_INFO("Incorrect parameters for ^2find^7\n"); + case CMD_REQUEST_USAGE: + { + LOG_INFO("\nUsage:^3 sv_cmd find classname\n"); + LOG_INFO(" Where 'classname' is the classname to search for.\n"); + return; + } + } +} + +SERVER_COMMAND(findat, "Search through entities for matching origin") +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + vector match = stov(argv(1)); + FOREACH_ENTITY_ORDERED(it.origin == match, LAMBDA(LOG_INFOF("%i\n", it))); + return; + } + + default: + LOG_INFO("Incorrect parameters for ^2findat^7\n"); + case CMD_REQUEST_USAGE: + { + LOG_INFO("\nUsage:^3 sv_cmd findat \"0 0 0\"\n"); + return; + } + } +} +#endif diff --git a/qcsrc/common/effects/all.qc b/qcsrc/common/effects/all.qc index 2bdf2ec48..a07228fbd 100644 --- a/qcsrc/common/effects/all.qc +++ b/qcsrc/common/effects/all.qc @@ -66,8 +66,7 @@ void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt) { if(!eff) { return; } if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count! - entity net_eff = new(net_effect); - make_pure(net_eff); + entity net_eff = new_pure(net_effect); net_eff.owner = eff; //net_eff.eent_broadcast = broadcast; net_eff.m_id = eff.m_id; diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 4d85ab909..06f8ea464 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -43,7 +43,6 @@ void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad deathtype |= 0x8000; e = new(damageinfo); - make_pure(e); setorigin(e, org); e.projectiledeathtype = deathtype; e.dmg = coredamage; @@ -179,7 +178,6 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum) } e = new(damage); - make_pure(e); setmodel(e, MDL_Null); // necessary to attach and read origin setattachment(e, self, gettaginfo_name); // attach to the given bone e.owner = self; diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index dbadc9abb..165d94b89 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -98,12 +98,12 @@ i += 1; ENTCS_NETPROPS(X); #undef X + setorigin(this, this.origin); // relink } void entcs_attach(entity player) { entity e = player.entcs = new(entcs_sender); - make_pure(e); e.owner = player; e.think = entcs_think; e.nextthink = time; diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index f748dda88..8f2f05fd1 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -56,8 +56,7 @@ bool Inventory_Send(entity this, entity to, int sf) void Inventory_new(entity e) { - Inventory inv = new(Inventory), bak = new(Inventory); - make_pure(inv); make_pure(bak); + Inventory inv = new_pure(Inventory), bak = new_pure(Inventory); inv.inventory = bak; inv.drawonlytoclient = e; Net_LinkEntity((inv.owner = e).inventory = inv, false, 0, Inventory_Send); diff --git a/qcsrc/common/minigames/cl_minigames.qh b/qcsrc/common/minigames/cl_minigames.qh index a97cabbf9..596d9204c 100644 --- a/qcsrc/common/minigames/cl_minigames.qh +++ b/qcsrc/common/minigames/cl_minigames.qh @@ -121,7 +121,6 @@ REGISTRY_CHECK(Minigames) void name##_hud_status(vector, vector); \ int name##_client_event(entity, string, ...); \ REGISTER_INIT_POST(MINIGAME_##name) { \ - make_pure(this); \ this.netname = strzone(strtolower(#name)); \ this.message = nicename; \ this.minigame_hud_board = name##_hud_board; \ diff --git a/qcsrc/common/minigames/sv_minigames.qh b/qcsrc/common/minigames/sv_minigames.qh index cde614416..ecef02856 100644 --- a/qcsrc/common/minigames/sv_minigames.qh +++ b/qcsrc/common/minigames/sv_minigames.qh @@ -54,7 +54,6 @@ REGISTRY_CHECK(Minigames) REGISTER(Minigames, MINIGAME_##name, m_id, new_pure(minigame_descriptor)); \ int name##_server_event(entity, string, ...); \ REGISTER_INIT_POST(MINIGAME_##name) { \ - make_pure(this); \ this.netname = strzone(strtolower(#name)); \ this.message = nicename; \ this.minigame_event = name##_server_event; \ diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 1cb2766ab..1fb8fda3b 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -997,7 +997,6 @@ entity WaypointSprite_Spawn( ) { entity wp = new(sprite_waypoint); - make_pure(wp); wp.teleport_time = time + _lifetime; wp.fade_time = _lifetime; wp.exteriormodeltoclient = ref; diff --git a/qcsrc/common/net_notice.qc b/qcsrc/common/net_notice.qc index 59061e5a9..fa98b2feb 100644 --- a/qcsrc/common/net_notice.qc +++ b/qcsrc/common/net_notice.qc @@ -48,8 +48,7 @@ STATIC_INIT(cl_notice) } void cl_notice_read() { - entity _notice = new(sv_notice); - make_pure(_notice); + entity _notice = new_pure(sv_notice); _notice.netname = strzone(ReadString()); _notice.alpha = ReadLong() + time; _notice.skin = ReadByte(); diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index e52e9de09..a23c95f1d 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1681,8 +1681,7 @@ void Send_Notification( } else { - entity net_notif = new(net_notification); - make_pure(net_notif); + entity net_notif = new_pure(net_notification); net_notif.owner = notif; net_notif.nent_broadcast = broadcast; net_notif.nent_client = client; diff --git a/qcsrc/common/sounds/sound.qh b/qcsrc/common/sounds/sound.qh index 53185b0fb..5d6c57f21 100644 --- a/qcsrc/common/sounds/sound.qh +++ b/qcsrc/common/sounds/sound.qh @@ -76,7 +76,6 @@ const float VOL_BASEVOICE = 1.0; auto = true; \ __chan = fabs(__chan); \ entity tmp = __e = new(csqc_autochannel); \ - make_pure(tmp); \ tmp.think = SUB_Remove_self; \ tmp.nextthink = time + soundlength(__samp); \ } \ diff --git a/qcsrc/common/triggers/target/music.qc b/qcsrc/common/triggers/target/music.qc index 015ad9138..3e0cca2a7 100644 --- a/qcsrc/common/triggers/target/music.qc +++ b/qcsrc/common/triggers/target/music.qc @@ -213,8 +213,7 @@ void Net_TargetMusic() LL_EACH(TargetMusic_list, it.count == id, LAMBDA(e = it; break)); if (!e) { - LL_PUSH(TargetMusic_list, e = new(TargetMusic)); - make_pure(e); + LL_PUSH(TargetMusic_list, e = new_pure(TargetMusic)); e.count = id; } if(e.noise != noi) diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index 507af7810..141fd458f 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -433,7 +433,7 @@ void target_push_init(entity this) spawnfunc(target_push) { target_push_init(this); } spawnfunc(info_notnull) { target_push_init(this); } -spawnfunc(target_position) { make_pure(this); target_push_init(this); } +spawnfunc(target_position) { target_push_init(this); } #elif defined(CSQC) @@ -473,7 +473,6 @@ void target_push_remove(entity this) NET_HANDLE(ENT_CLIENT_TARGET_PUSH, bool isnew) { - make_pure(this); self.classname = "push_target"; self.cnt = ReadByte(); self.targetname = strzone(ReadString()); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 03ab8f6d5..0e6b6d6ba 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -608,8 +608,7 @@ float cvar_settemp(string tmp_cvar, string tmp_value) if(created_saved_value != -1) { // creating a new entity to keep track of this cvar - entity e = new(saved_cvar_value); - make_pure(e); + entity e = new_pure(saved_cvar_value); e.netname = strzone(tmp_cvar); e.message = strzone(cvar_string(tmp_cvar)); created_saved_value = 1; diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index c1a7e3023..def5003c6 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -425,7 +425,6 @@ void CL_WeaponEntity_SetModel(entity this, string name) if (!this.weaponchild) { this.weaponchild = new(weaponchild); - make_pure(this.weaponchild); #ifdef CSQC this.weaponchild.drawmask = MASK_NORMAL; this.weaponchild.renderflags |= RF_VIEWMODEL; diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index bb9a54dcd..6c6e8e736 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -239,8 +239,7 @@ void W_Shockwave_Melee(Weapon thiswep, entity actor, .entity weaponentity, int f sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready); - entity meleetemp = new(meleetemp); - make_pure(meleetemp); + entity meleetemp = new_pure(meleetemp); meleetemp.owner = meleetemp.realowner = actor; meleetemp.think = W_Shockwave_Melee_Think; meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor(); diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 898f9162c..234aaadaf 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -188,8 +188,7 @@ void W_Shotgun_Attack2(Weapon thiswep, entity actor, .entity weaponentity, int f sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready); - entity meleetemp = new(meleetemp); - make_pure(meleetemp); + entity meleetemp = new_pure(meleetemp); meleetemp.realowner = actor; meleetemp.think = W_Shotgun_Melee_Think; meleetemp.nextthink = time + WEP_CVAR_SEC(shotgun, melee_delay) * W_WeaponRateFactor(); diff --git a/qcsrc/lib/defer.qh b/qcsrc/lib/defer.qh index 070c09275..b923062bc 100644 --- a/qcsrc/lib/defer.qh +++ b/qcsrc/lib/defer.qh @@ -37,8 +37,7 @@ */ void defer(entity this, float fdelay, void() func) { - entity e = new(deferred); - make_pure(e); + entity e = new_pure(deferred); e.owner = this; e.use = func; e.think = defer_think; diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index efcb7876a..8d50d2b92 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -12,7 +12,7 @@ .vector origin; .bool pure_data; -/** deprecated, use new_pure or NEW(class) */ +/** @deprecated, use new_pure or NEW(class) */ #define make_pure(e) \ MACRO_BEGIN \ { \ @@ -34,6 +34,7 @@ entity _spawn(); #define SPAWN_PURE 0 #endif +// pure entities: need no .origin #if SPAWN_PURE entity spawn_pure() = #600; #else @@ -80,7 +81,6 @@ entity _clearentity_ent; STATIC_INIT(clearentity) { _clearentity_ent = new_pure(clearentity); - make_pure(_clearentity_ent); } void clearentity(entity e) { diff --git a/qcsrc/lib/sortlist.qc b/qcsrc/lib/sortlist.qc index fecc79bdf..1d8726c89 100644 --- a/qcsrc/lib/sortlist.qc +++ b/qcsrc/lib/sortlist.qc @@ -2,8 +2,7 @@ entity Sort_Spawn() { - entity sort = new(sortlist); - make_pure(sort); + entity sort = new_pure(sortlist); sort.sort_next = NULL; sort.chain = sort; return sort; diff --git a/qcsrc/lib/urllib.qc b/qcsrc/lib/urllib.qc index 0a48ef6cd..80145d8b8 100644 --- a/qcsrc/lib/urllib.qc +++ b/qcsrc/lib/urllib.qc @@ -94,8 +94,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) // attempts to close will result in a reading handle // create a writing end that does nothing yet - e = new(url_single_fopen_file); - make_pure(e); + e = new_pure(url_single_fopen_file); e.url_url = strzone(url); e.url_fh = URL_FH_CURL; e.url_wbuf = buf_create(); @@ -143,8 +142,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) // Make a dummy handle object (no buffers at // all). Wait for data to come from the // server, then call the callback - e = new(url_single_fopen_file); - make_pure(e); + e = new_pure(url_single_fopen_file); e.url_url = strzone(url); e.url_fh = URL_FH_CURL; e.url_rbuf = -1; @@ -165,8 +163,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) { case FILE_WRITE: case FILE_APPEND: - e = new(url_single_fopen_stdout); - make_pure(e); + e = new_pure(url_single_fopen_stdout); e.url_fh = URL_FH_STDOUT; e.url_ready = rdy; e.url_ready_pass = pass; @@ -189,8 +186,7 @@ void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) } else { - e = new(url_single_fopen_file); - make_pure(e); + e = new_pure(url_single_fopen_file); e.url_fh = fh; e.url_ready = rdy; e.url_ready_pass = pass; @@ -364,8 +360,7 @@ void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass) return; } - entity me = new(url_multi); - make_pure(me); + entity me = new_pure(url_multi); me.url_url = strzone(url); me.url_attempt = 0; me.url_mode = mode; diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 5a9b2abf9..b3332f36f 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -186,8 +186,7 @@ void WarpZone_Trace_InitTransform() { if(!WarpZone_trace_transform) { - WarpZone_trace_transform = new(warpzone_trace_transform); - make_pure(WarpZone_trace_transform); + WarpZone_trace_transform = new_pure(warpzone_trace_transform); } WarpZone_Accumulator_Clear(WarpZone_trace_transform); } diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index f15c9a6fb..7b349f479 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -1112,7 +1112,7 @@ void bot_setcurrentcommand() if(!self.bot_cmd_current) { - self.bot_cmd_current = new(bot_cmd); + self.bot_cmd_current = new_pure(bot_cmd); self.bot_cmd_current.is_bot_cmd = true; } diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index e2e505ace..178bc637c 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -28,7 +28,6 @@ entity waypoint_spawn(vector m1, vector m2, float f) } w = new(waypoint); - make_pure(w); w.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP; w.wpflags = f; setorigin(w, (m1 + m2) * 0.5); diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index edf70c120..f2e075c4d 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -86,8 +86,7 @@ bool ClientData_Send(entity this, entity to, int sf) void ClientData_Attach(entity this) { - Net_LinkEntity(this.clientdata = new(clientdata), false, 0, ClientData_Send); - make_pure(this.clientdata); + Net_LinkEntity(this.clientdata = new_pure(clientdata), false, 0, ClientData_Send); self.clientdata.drawonlytoclient = this; self.clientdata.owner = this; } @@ -517,8 +516,7 @@ void PutClientInServer() this.revival_time = 0; this.air_finished = time + 12; - entity spawnevent = new(spawnevent); - make_pure(spawnevent); + entity spawnevent = new_pure(spawnevent); spawnevent.owner = this; Net_LinkEntity(spawnevent, false, 0.5, SpawnEvent_Send); @@ -658,8 +656,7 @@ void ClientInit_CheckUpdate() void ClientInit_Spawn() {SELFPARAM(); - entity e = new(clientinit); - make_pure(e); + entity e = new_pure(clientinit); e.think = ClientInit_CheckUpdate; Net_LinkEntity(e, false, 0, ClientInit_SendEntity); diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 369b3eaa9..056cb0db4 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -735,31 +735,6 @@ void GameCommand_extendmatchtime(float request) } } -void GameCommand_find(float request, float argc) // is this even needed? We have prvm_edicts command and such ANYWAY -{ - switch (request) - { - case CMD_REQUEST_COMMAND: - { - entity client; - - for (client = world; (client = find(client, classname, argv(1))); ) - LOG_INFO(etos(client), "\n"); - - return; - } - - default: - LOG_INFO("Incorrect parameters for ^2find^7\n"); - case CMD_REQUEST_USAGE: - { - LOG_INFO("\nUsage:^3 sv_cmd find classname\n"); - LOG_INFO(" Where 'classname' is the classname to search for.\n"); - return; - } - } -} - void GameCommand_gametype(float request, float argc) { switch (request) @@ -1778,7 +1753,6 @@ SERVER_COMMAND(defer_clear_all, "Clear all queued defer commands for all clients SERVER_COMMAND(delrec, "Delete race time record for a map") { GameCommand_delrec(request, arguments); } SERVER_COMMAND(effectindexdump, "Dump list of effects from code and effectinfo.txt") { GameCommand_effectindexdump(request); } SERVER_COMMAND(extendmatchtime, "Increase the timelimit value incrementally") { GameCommand_extendmatchtime(request); } -SERVER_COMMAND(find, "Search through entities for matching classname") { GameCommand_find(request, arguments); } SERVER_COMMAND(gametype, "Simple command to change the active gametype") { GameCommand_gametype(request, arguments); } SERVER_COMMAND(gettaginfo, "Get specific information about a weapon model") { GameCommand_gettaginfo(request, arguments); } SERVER_COMMAND(gotomap, "Simple command to switch to another map") { GameCommand_gotomap(request, arguments); } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index c4303f479..1e00e8562 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -86,8 +86,7 @@ bool Nagger_SendEntity(entity this, entity to, float sendflags) void Nagger_Init() { - Net_LinkEntity(nagger = new(nagger), false, 0, Nagger_SendEntity); - make_pure(nagger); + Net_LinkEntity(nagger = new_pure(nagger), false, 0, Nagger_SendEntity); } void Nagger_VoteChanged() @@ -445,8 +444,7 @@ void ReadyRestart_force() // initiate the restart-countdown-announcer entity if (autocvar_sv_ready_restart_after_countdown) { - entity restart_timer = new(restart_timer); - make_pure(restart_timer); + entity restart_timer = new_pure(restart_timer); restart_timer.think = ReadyRestart_think; restart_timer.nextthink = game_starttime; } diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index c57d545de..9059a6d51 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -80,8 +80,7 @@ void PingPLReport_Think() } void PingPLReport_Spawn() { - pingplreport = new(pingplreport); - make_pure(pingplreport); + pingplreport = new_pure(pingplreport); pingplreport.think = PingPLReport_Think; pingplreport.nextthink = time; } @@ -523,8 +522,7 @@ void RandomSeed_Think() } void RandomSeed_Spawn() {SELFPARAM(); - randomseed = new(randomseed); - make_pure(randomseed); + randomseed = new_pure(randomseed); randomseed.think = RandomSeed_Think; Net_LinkEntity(randomseed, false, 0, RandomSeed_Send); diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 4e4d69b06..b7c994598 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -89,8 +89,7 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags) void TeamScore_Spawn(float t, string name) { - entity ts = new(csqc_score_team); - make_pure(ts); + entity ts = new_pure(csqc_score_team); ts.netname = name; // not used yet, FIXME ts.team = t; Net_LinkEntity(ts, false, 0, TeamScore_SendEntity); @@ -212,8 +211,7 @@ void ScoreInfo_Init(float teams) } else { - scores_initialized = new(ent_client_scoreinfo); - make_pure(scores_initialized); + scores_initialized = new_pure(ent_client_scoreinfo); Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity); } if(teams >= 1) @@ -319,8 +317,7 @@ void PlayerScore_Attach(entity player) { if(player.scorekeeper) error("player already has a scorekeeper"); - entity sk = new(scorekeeper); - make_pure(sk); + entity sk = new_pure(scorekeeper); sk.owner = player; Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity); player.scorekeeper = sk; diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 944811029..abb41ad06 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -39,8 +39,7 @@ bool accuracy_send(entity this, entity to, int sf) // init/free void accuracy_init(entity e) { - entity a = e.accuracy = new(accuracy); - make_pure(a); + entity a = e.accuracy = new_pure(accuracy); a.owner = e; a.drawonlytoclient = e; Net_LinkEntity(a, false, 0, accuracy_send); diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 6d33ccb06..3fd9e896f 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -161,7 +161,6 @@ void CL_ExteriorWeaponentity_Think() void CL_SpawnWeaponentity(entity actor, .entity weaponentity) { entity view = actor.(weaponentity) = new(weaponentity); - make_pure(view); view.solid = SOLID_NOT; view.owner = actor; setmodel(view, MDL_Null); // precision set when changed @@ -175,7 +174,6 @@ void CL_SpawnWeaponentity(entity actor, .entity weaponentity) if (weaponentity == weaponentities[0]) { entity exterior = actor.exteriorweaponentity = new(exteriorweaponentity); - make_pure(exterior); exterior.solid = SOLID_NOT; exterior.owner = actor; setorigin(exterior, '0 0 0');