]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Fix "When using the Mine Layer, the game can crash because it tries to free a constan...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index 1dc444b3ec3181e8012bfcb9182416d996cd7512..70d57beefb762909e4c87dab55615da98cf8aa7f 100644 (file)
@@ -1960,14 +1960,13 @@ void unfollow_sameorigin(entity e)
 .float aiment_deadflag;
 void SetMovetypeFollow(entity ent, entity e)
 {
-       // FIXME this may not be warpzone aware
        set_movetype(ent, MOVETYPE_FOLLOW); // make the hole follow
        ent.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid - this means this cannot be teleported by warpzones any more! Instead, we must notice when our owner gets teleported.
        ent.aiment = e; // make the hole follow bmodel
        ent.punchangle = e.angles; // the original angles of bmodel
        ent.view_ofs = ent.origin - e.origin; // relative origin
        ent.v_angle = ent.angles - e.angles; // relative angles
-       ent.aiment_classname = strzone(e.classname);
+       strcpy(ent.aiment_classname, e.classname);
        ent.aiment_deadflag = e.deadflag;
 
        if(IS_PLAYER(ent.aiment))
@@ -1983,8 +1982,7 @@ void UnsetMovetypeFollow(entity ent)
 {
        set_movetype(ent, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(ent);
-       if (ent.aiment_classname)
-               strunzone(ent.classname);
+       strfree(ent.aiment_classname);
        // FIXME: engine bug?
        // resetting aiment the engine will set orb's origin close to world's origin
        //ent.aiment = NULL;