]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
etof: avoid tempstring
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 Dec 2015 23:54:26 +0000 (10:54 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 12 Dec 2015 23:54:26 +0000 (10:54 +1100)
24 files changed:
qcsrc/client/main.qc
qcsrc/common/debug.qh
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/movetypes/movetypes.qc
qcsrc/common/sounds/all.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/lib/misc.qh
qcsrc/lib/unsafe.qh
qcsrc/server/_all.qh
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/common.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_hook.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/scores.qc
qcsrc/server/spawnpoints.qc

index 3ee92bd6fe7f9d5859eb8fb364e6d5afc27d77d9..8e9e14a3a6ceaa57d2926bdfb31b9c60ec6116ff 100644 (file)
@@ -359,7 +359,7 @@ NET_HANDLE(ENT_CLIENT_SCORES, bool isnew)
        if(!isNew && n != this.sv_entnum)
        {
                //print("A CSQC entity changed its owner!\n");
-               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(this), this.classname);
+               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", etof(this), this.classname);
                isNew = true;
                Ent_Remove();
        }
@@ -738,7 +738,7 @@ void CSQC_Ent_Update(bool isnew)
        {
                if (t != this.enttype || isnew)
                {
-                       LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(this), this.entnum, this.enttype, t);
+                       LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", etof(this), this.entnum, this.enttype, t);
                        Ent_Remove();
                        clearentity(this);
                        isnew = true;
@@ -748,7 +748,7 @@ void CSQC_Ent_Update(bool isnew)
        {
                if (!isnew)
                {
-                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(this), this.entnum, t);
+                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", etof(this), this.entnum, t);
                        isnew = true;
                }
        }
index c5345b32a33b4112a5aae9a49a37600290c69d4a..7470235f1ba156aaac09e9e4a8fa1bdc73b75571 100644 (file)
@@ -28,7 +28,7 @@ REGISTER_NET_TEMP(net_debug)
                int channel = MSG_ONE;
                msg_entity = to;
                WriteHeader(channel, net_debug);
-               WriteShort(channel, num_for_edict(this));
+               WriteShort(channel, etof(this));
                WriteByte(channel, is_pure(this));
                WriteCoord(channel, this.origin.x);
                WriteCoord(channel, this.origin.y);
@@ -71,7 +71,7 @@ bool autocvar_debugdraw;
                                pos.z = 0;
                                pos.y += ofs * size;
                                drawcolorcodedstring2(pos,
-                                       sprintf("%d: '%s'@%s:%d", (e.debug ? e.sv_entnum : num_for_edict(e)),
+                                       sprintf("%d: '%s'@%s:%d", (e.debug ? e.sv_entnum : etof(e)),
                                        e.classname, e.sourceLocFile, e.sourceLocLine),
                                        size * '1 1 0', rgb, 0.5, DRAWFLAG_NORMAL);
                                ++ofs;
index 3c778b52ba363feab38f4edfdcdf8e2dfacc181a..19f47500e5d19f1b9efef96e5b109679cdcd181f 100644 (file)
@@ -34,9 +34,9 @@ void Violence_GibSplash_At(vector org, vector dir, float type, float amount, ent
        // if this is a copied dead body, send the num of its player instead
        // TODO: remove this field, read from model txt files
        if(self.classname == "body")
-               e.team = num_for_edict(self.enemy);
+               e.team = etof(self.enemy);
        else
-               e.team = num_for_edict(self);
+               e.team = etof(self);
 
        setorigin(e, org);
        e.velocity = dir;
index a9f4a4f4cfab763ce23a22572b74b964bacb4a26..ea5596f080108ac6065d95cdb874dbd75478a846 100644 (file)
@@ -74,7 +74,7 @@ MINIGAME_SIMPLELINKED_ENTITIES
 
 void minigame_autoclean_entity(entity e)
 {
-       LOG_DEBUG("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+       LOG_DEBUG("CL Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")\n");
        remove(e);
 }
 
@@ -235,7 +235,7 @@ NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew)
 
        if ( sf & MINIG_SF_CREATE )
        {
-               LOG_DEBUG("CL Reading entity: ",ftos(num_for_edict(self)),
+               LOG_DEBUG("CL Reading entity: ",ftos(etof(self)),
                        " classname:",self.classname," enttype:",ftos(self.enttype) );
                LOG_DEBUG(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
        }
index 672f7f0bdff3b6720263fb3e0360f7ade90732c9..ca111e6c8cd978dd4bdd69482b0561345096d647 100644 (file)
@@ -25,7 +25,7 @@ void minigame_rmplayer(entity minigame_session, entity player)
                }
                minigame_session.minigame_event(minigame_session,"part",player);
                GameLogEcho(strcat(":minigame:part:",minigame_session.netname,":",
-                       ftos(num_for_edict(player)),":",player.netname));
+                       ftos(etof(player)),":",player.netname));
                minigame_session.minigame_players = p.list_next;
                remove ( p );
                player_clear_minigame(player);
@@ -38,7 +38,7 @@ void minigame_rmplayer(entity minigame_session, entity player)
                        {
                                minigame_session.minigame_event(minigame_session,"part",player);
                                GameLogEcho(strcat(":minigame:part:",minigame_session.netname,":",
-                                       ftos(num_for_edict(player)),":",player.netname));
+                                       ftos(etof(player)),":",player.netname));
                                p.list_next = e.list_next;
                                remove(e);
                                player_clear_minigame(player);
@@ -86,7 +86,7 @@ bool minigame_SendEntity(entity this, entity to, int sf)
                if ( sf & MINIG_SF_CREATE )
                {
                        WriteString(MSG_ENTITY,self.owner.netname);
-                       WriteLong(MSG_ENTITY,num_for_edict(self.minigame_players));
+                       WriteLong(MSG_ENTITY,etof(self.minigame_players));
                }
                if ( sf & MINIG_SF_UPDATE )
                        WriteByte(MSG_ENTITY,self.team);
@@ -155,7 +155,7 @@ int minigame_addplayer(entity minigame_session, entity player)
        }
        else { remove(player_pointer); }
        GameLogEcho(strcat(":minigame:join",(mgteam?"":"fail"),":",minigame_session.netname,":",
-               ftos(num_for_edict(player)),":",player.netname));
+               ftos(etof(player)),":",player.netname));
 
        return mgteam;
 }
@@ -169,7 +169,7 @@ entity start_minigame(entity player, string minigame )
        if ( e )
        {
                entity minig = new(minigame);
-               minig.netname = strzone(strcat(e.netname,"_",ftos(num_for_edict(minig))));
+               minig.netname = strzone(strcat(e.netname,"_",ftos(etof(minig))));
                minig.descriptor = e;
                minig.minigame_event = e.minigame_event;
                minig.minigame_event(minig,"start");
@@ -235,7 +235,7 @@ void end_minigame(entity minigame_session)
        while( (e = findentity(e, owner, minigame_session)) )
                if ( e.minigame_autoclean )
                {
-                       LOG_TRACE("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+                       LOG_TRACE("SV Auto-cleaned: ",ftos(etof(e)), " (",e.classname,")\n");
                        remove(e);
                }
 
@@ -274,7 +274,7 @@ string invite_minigame(entity inviter, entity player)
                inviter.active_minigame.netname, inviter.netname );
 
        GameLogEcho(strcat(":minigame:invite:",inviter.active_minigame.netname,":",
-               ftos(num_for_edict(player)),":",player.netname));
+               ftos(etof(player)),":",player.netname));
 
        return "";
 }
index f6b52dae0784e60fc08b8ddbcc20111d179ba136..debe1a319e166789cd92c1a0b827057c259a4307 100644 (file)
@@ -442,11 +442,11 @@ bool _Movetype_UnstickEntity(entity this)  // SV_UnstickEntity
                if(!_Movetype_TestEntityPosition(this, '0 0 1' * i)) goto success;
        }
        LOG_DEBUG("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
-               num_for_edict(this), this.classname, vtos(this.move_origin));
+               etof(this), this.classname, vtos(this.move_origin));
        return false;
        : success;
        LOG_DEBUG("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
-               num_for_edict(this), this.classname, vtos(this.move_origin));
+               etof(this), this.classname, vtos(this.move_origin));
        _Movetype_LinkEdict(this, true);
        return true;
 }
index 92c5ef059ae7e160b2f282f886c96135b6f86467..0ec413c37edd53c6d2572e5bcc0bce1128d63715 100644 (file)
@@ -76,7 +76,7 @@ void soundat(entity e, vector o, int chan, string samp, float vol, float _atten)
 void stopsoundto(int _dest, entity e, int chan)
 {
        if (!sound_allowed(_dest, e)) return;
-       int entno = num_for_edict(e);
+       int entno = etof(e);
        if (entno >= 8192 || chan < 0 || chan > 7)
        {
                int idx = precache_sound_index(SND(Null));
index 7f97668c88dfbaac8ffd0a4ebf2537f394270e9b..1d8864f2c74291c66c687252c5cd8608f4704bd9 100644 (file)
@@ -23,7 +23,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_TRIGGER_MUSIC)
 void target_music_sendto(float to, float is)
 {SELFPARAM();
        WriteHeader(to, TE_CSQC_TARGET_MUSIC);
-       WriteShort(to, num_for_edict(self));
+       WriteShort(to, etof(self));
        WriteByte(to, self.volume * 255.0 * is);
        WriteByte(to, self.fade_time * 16.0);
        WriteByte(to, self.fade_rate * 16.0);
index b95837127f3b9b18ecb262643d66ed94d0cce10d..59737cb992951fbeeb5f6e072c2a3f798d06a729 100644 (file)
@@ -157,7 +157,7 @@ void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity
                                if(valuefield == "")
                                {
                                        if(value == "")
-                                               value = ftos(num_for_edict(valueent));
+                                               value = ftos(etof(valueent));
                                }
                                else
                                {
index 8ff604579c246715959e4164c7290bab31bd79bd..11ee8ebc7eed104bcc529b5b09e89794cf936f9c 100644 (file)
@@ -37,7 +37,7 @@ bool bumble_raygun_send(entity this, entity to, float sf)
     WriteByte(MSG_ENTITY, sf);
     if(sf & BRG_SETUP)
     {
-        WriteByte(MSG_ENTITY, num_for_edict(self.realowner));
+        WriteByte(MSG_ENTITY, etof(self.realowner));
         WriteByte(MSG_ENTITY, self.realowner.team);
         WriteByte(MSG_ENTITY, self.cnt);
     }
index bc1d768d20ca085595841fc5e57670e781b06112..fb5fbf4bbb96fa36bb97a4ed3960b3e7630017c2 100644 (file)
@@ -352,7 +352,7 @@ void W_Shockwave_Send()
        WriteShort(MSG_BROADCAST, WEP_CVAR(shockwave, blast_distance));
        WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_max), 255));
        WriteByte(MSG_BROADCAST, bound(0, WEP_CVAR(shockwave, blast_spread_min), 255));
-       WriteByte(MSG_BROADCAST, num_for_edict(self));
+       WriteByte(MSG_BROADCAST, etof(self));
 }
 
 void W_Shockwave_Attack()
index 529435d3562086831bd84746772a3caae59e2c46..d3c47ee5fa031adf2caab63baef747aa9c3bf658 100644 (file)
@@ -75,7 +75,7 @@ void SendCSQCVaporizerBeamParticle(entity player, int hit) {
        WriteCoord(MSG_BROADCAST, v.y);
        WriteCoord(MSG_BROADCAST, v.z);
        WriteByte(MSG_BROADCAST, hit);
-       WriteByte(MSG_BROADCAST, num_for_edict(player));
+       WriteByte(MSG_BROADCAST, etof(player));
        WriteByte(MSG_BROADCAST, player.team);
 }
 #elif defined(CSQC)
index 9ce52dfb596c3d328d3e53eeb7385da3c7de69cb..589783ae959f4b87ff63c96922c93568ecd6a8b6 100644 (file)
        // already defined
 #endif
 
-#undef etof
 // avoid bounds checks
-#define etof(e) stof(sprintf("%i", e))
+#undef etof
+#if 1
+       #define etof(e) ITOF(reinterpret_cast(int, e))
+#else
+       #define etof(e) stof(sprintf("%i", e))
+#endif
 
 #define GET(name) name##get
 #define GETTER(type, name) type GET(name)() { return name; }
index f8fa38280dd709742bf96fc99c07cfb2be31a5b4..b218b660a534f1468bc84f8e7a51c9f89aea7ed0 100644 (file)
@@ -3,6 +3,8 @@
 
 #define reinterpret_cast(T, it) _unsafe_cast_##T(0, it)
 #define X(T) T _unsafe_cast_##T(int dummy, ...) { return ...(0, T); }
+X(bool)
+X(int)
 X(float)
 X(entity)
 X(string)
@@ -10,6 +12,17 @@ typedef float(...) rawfunc;
 X(rawfunc)
 #undef X
 
-#define strid(s) etof(reinterpret_cast(entity, s))
+#define strid(s) ITOF(reinterpret_cast(int, s))
+
+.int _unsafe_fld1, _unsafe_fld2;
+int INTEGER_ONE;
+
+#define FTOI(f) ((f) * INTEGER_ONE)
+#define ITOF(i) ((i) / INTEGER_ONE)
+
+STATIC_INIT(INTEGER_ONE)
+{
+    INTEGER_ONE = reinterpret_cast(int, _unsafe_fld2) - reinterpret_cast(int, _unsafe_fld1);
+}
 
 #endif
index a53ab2435ddb67b3f24735ae6a48eb5b8c08c70c..f277af62ab7a6953f7d2a7c96f2e914c8aa9d093 100644 (file)
@@ -20,7 +20,7 @@ const string STR_OBSERVER = "observer";
 #define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
 #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
 
-#define FOR_EACH_CLIENTSLOT(v) for (v = world; (v = nextent(v)) && (num_for_edict(v) <= maxclients); )
+#define FOR_EACH_CLIENTSLOT(v) for (v = world; (v = nextent(v)) && (etof(v) <= maxclients); )
 #define FOR_EACH_CLIENT(v) FOR_EACH_CLIENTSLOT(v) if (IS_CLIENT(v))
 #define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if (IS_REAL_CLIENT(v))
 
@@ -32,7 +32,7 @@ const string STR_OBSERVER = "observer";
 #define FOREACH_CLIENT(cond, body) \
        MACRO_BEGIN { \
                int i = 0; \
-               for (entity it = NULL; (it = nextent(it)) && (num_for_edict(it) <= maxclients); ++i) \
+               for (entity it = NULL; (it = nextent(it)) && (etof(it) <= maxclients); ++i) \
                { \
                        if (!IS_CLIENT(it)) continue; \
                        if (cond) { LAMBDA(body) } \
index 996058f1d4f2c75439eda161044543eb70a43b96..7718f96fb59b0684ac4101f58652f270aab2c4c3 100644 (file)
@@ -599,7 +599,7 @@ float CheatCommand(float argc)
                                                        {
                                                                if(vlen(oldself.origin - start) < vlen(e.origin - start))
                                                                        ++effectnum;
-                                                               else if(vlen(oldself.origin - start) == vlen(e.origin - start) && num_for_edict(oldself) < num_for_edict(e))
+                                                               else if(vlen(oldself.origin - start) == vlen(e.origin - start) && etof(oldself) < etof(e))
                                                                        ++effectnum;
                                                        }
                                                        fputs(f, strcat("\"race_place\" \"", ftos(effectnum), "\"\n"));
index 7a113d24a7c6b2badd55c742e677d6a5c94305d5..d3d14a5cfb5118b180e52eeaf1e7a148897cf779 100644 (file)
@@ -987,7 +987,7 @@ void ClientPreConnect ()
        {
                GameLogEcho(sprintf(":connect:%d:%d:%s",
                        self.playerid,
-                       num_for_edict(self),
+                       etof(self),
                        ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot")
                ));
        }
@@ -1122,7 +1122,7 @@ void ClientConnect ()
         PlayerStats_GameReport_AddPlayer(self);
 
        if(autocvar_sv_eventlog)
-               GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
+               GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(etof(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
 
        LogTeamchange(self.playerid, self.team, 1);
 
@@ -2481,9 +2481,9 @@ void PlayerPreThink ()
        float oldspectatee_status;
        oldspectatee_status = self.spectatee_status;
        if(IS_SPEC(self))
-               self.spectatee_status = num_for_edict(self.enemy);
+               self.spectatee_status = etof(self.enemy);
        else if(IS_OBSERVER(self))
-               self.spectatee_status = num_for_edict(self);
+               self.spectatee_status = etof(self);
        else
                self.spectatee_status = 0;
        if(self.spectatee_status != oldspectatee_status)
index 69f0222cb7d24586da4dc6ba64a191c558a360d8..484ecb2104d208ac969ba5c50825eeb1e186d1c3 100644 (file)
@@ -155,7 +155,7 @@ float GetFilteredNumber(string input)
        entity selection = GetFilteredEntity(input);
        float output;
 
-       output = num_for_edict(selection);
+       output = etof(selection);
 
        return output;
 }
@@ -791,7 +791,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                                }
 
                                print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "),
-                                       num_for_edict(tmp_player),
+                                       etof(tmp_player),
                                        tmp_player.netname,
                                        tmp_player.ping,
                                        tmp_player.ping_packetloss,
index 38e6222d6109131355521362eda560d4b2d32142..1cb3791125e25dca134a2569ccdbaf2429af3281 100644 (file)
@@ -559,7 +559,7 @@ void GameCommand_defer_clear_all(float request)
 
                        FOR_EACH_CLIENT(client)
                        {
-                               argc = tokenize_console(strcat("defer_clear ", ftos(num_for_edict(client))));
+                               argc = tokenize_console(strcat("defer_clear ", ftos(etof(client))));
                                GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
                                ++i;
                        }
@@ -1402,7 +1402,7 @@ void GameCommand_shuffleteams(float request)
                                                }
                                                else
                                                {
-                                                       shuffleteams_players[i] = num_for_edict(tmp_player);
+                                                       shuffleteams_players[i] = etof(tmp_player);
                                                        break;
                                                }
                                        }
index a023594a5f8c0be0cbcc95ead050513fa64ae022..d1598e239cae5a5e85b889f48eca58004d1f3a97 100644 (file)
@@ -697,7 +697,7 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl
                                if (first_command == "kickban") command_arguments = strcat(ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ~");
                                else command_arguments = reason;
 
-                               vote_parsed_command = strcat(first_command, " # ", ftos(num_for_edict(victim)), " ", command_arguments);
+                               vote_parsed_command = strcat(first_command, " # ", ftos(etof(victim)), " ", command_arguments);
                                vote_parsed_display = strcat("^1", vote_command, " (^7", victim.netname, "^1): ", reason);
                        }
                        else { print_to(caller, strcat("vcall: ", GetClientErrorString(accepted, argv(startpos + 1)), ".\n")); return false; }
index 360078d2a31124fde23eb212159440944d802649..06c49907b6d7360444174160142832423b8d4a73 100644 (file)
@@ -113,7 +113,7 @@ bool GrapplingHookSend(entity this, entity to, int sf)
        WriteByte(MSG_ENTITY, sf);
        if(sf & 1)
        {
-               WriteByte(MSG_ENTITY, num_for_edict(self.realowner));
+               WriteByte(MSG_ENTITY, etof(self.realowner));
        }
        if(sf & 2)
        {
index d5e41b9477edd9a15888aac9faad631c8c527667..7e8f4cfd357e5930fa1ca9e7cd4da8273b1bb95e 100644 (file)
@@ -1060,7 +1060,7 @@ float SUB_NoImpactCheck()
        if(trace_dphitcontents == 0)
        {
                //dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
-               LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
+               LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", etof(self), self.classname, vtos(self.origin));
                checkclient();
        }
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
index 8b740ef88b66e3c3ed88628f93acb07140159200..e29d1723ba0aaa24abfaa124be7504695f80db9c 100644 (file)
@@ -235,7 +235,7 @@ bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
        float i, p, longflags;
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES);
-       WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+       WriteByte(MSG_ENTITY, etof(self.owner));
 
        longflags = 0;
        for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
@@ -383,7 +383,7 @@ float PlayerScore_Compare(entity t1, entity t2, float strict)
        }
 
        if (result.x == 0 && strict)
-               result.x = num_for_edict(t1.owner) - num_for_edict(t2.owner);
+               result.x = etof(t1.owner) - etof(t2.owner);
 
        return result.x;
 }
index 36b08008e8b7dedfa643c1b931a60187c18a7e82..55662892acdff8160f7a6fefd5d625754b17bdf9 100644 (file)
@@ -30,7 +30,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf)
 
        if(autocvar_g_spawn_alloweffects)
        {
-               WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+               WriteByte(MSG_ENTITY, etof(self.owner));
                WriteShort(MSG_ENTITY, self.owner.origin.x);
                WriteShort(MSG_ENTITY, self.owner.origin.y);
                WriteShort(MSG_ENTITY, self.owner.origin.z);