]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) check not working...
authorterencehill <piuntn@gmail.com>
Sat, 16 Mar 2024 17:28:33 +0000 (18:28 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 16 Mar 2024 17:28:33 +0000 (18:28 +0100)
qcsrc/server/client.qc

index 58473889bb423d0d71334acd55f589922335cecb..c1ee3aceb39780f2b3ede953fd45ff0aac798c60 100644 (file)
@@ -1204,6 +1204,11 @@ void ClientConnect(entity this)
                localcmd("\nsv_hook_firstjoin\n");
        }
 }
+
+.string shootfromfixedorigin;
+.entity chatbubbleentity;
+void player_powerups_remove_all(entity this);
+
 /*
 =============
 ClientDisconnect
@@ -1211,9 +1216,6 @@ ClientDisconnect
 Called when a client disconnects from the server
 =============
 */
-.entity chatbubbleentity;
-void player_powerups_remove_all(entity this);
-
 void ClientDisconnect(entity this)
 {
        assert(IS_CLIENT(this), return);
@@ -1257,6 +1259,8 @@ void ClientDisconnect(entity this)
 
        RemoveGrapplingHooks(this);
 
+       strfree(this.shootfromfixedorigin);
+
        // Here, everything has been done that requires this player to be a client.
 
        this.flags &= ~FL_CLIENT;
@@ -2124,7 +2128,6 @@ void show_entnum(entity this)
                this.wp_aimed = ent;
 }
 
-.string shootfromfixedorigin;
 .bool dualwielding_prev;
 bool PlayerThink(entity this)
 {
@@ -2226,7 +2229,7 @@ bool PlayerThink(entity this)
        FixPlayermodel(this);
 
        if (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) {
-               this.shootfromfixedorigin = autocvar_g_shootfromfixedorigin;
+               strcpy(this.shootfromfixedorigin, autocvar_g_shootfromfixedorigin);
                stuffcmd(this, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
        }