From: Mircea Kitsune Date: Sun, 30 Oct 2011 09:53:30 +0000 (+0200) Subject: Only update owner name if necessary, and fix some silly bugs I left in X-Git-Tag: xonotic-v0.6.0~35^2~18^2~28 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1b3d53b8b2cf574aad64beb439f6a0ac9e22d893;p=xonotic%2Fxonotic-data.pk3dir.git Only update owner name if necessary, and fix some silly bugs I left in --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 88cd813ae..9e779eaec 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -610,7 +610,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) // update last edit time if(e.message2) strunzone(e.message2); - e.message2 = strftime(TRUE, "%d-%m-%Y %H:%M:%S"); + e.message2 = strzone(strftime(TRUE, "%d-%m-%Y %H:%M:%S")); if(autocvar_g_sandbox_info > 1) print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n")); @@ -633,9 +633,13 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) { // update the owner's name // Do this before checking if you're already the owner and skipping if such, so we - // also update the nickname if the player changed it (and has the same player UID) - if(e.netname) strunzone(e.netname); - e.netname = strftime(TRUE, "%d-%m-%Y %H:%M:%S"); + // also update the player's nickname if he changed it (but has the same player UID) + if(e.netname != self.netname) + { + if(e.netname) strunzone(e.netname); + e.netname = strzone(self.netname); + print_to(self, "^2SANDBOX - INFO: ^7Object owner name updated"); + } if(e.crypto_idfp == self.crypto_idfp) { @@ -644,7 +648,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) } if(e.crypto_idfp) strunzone(e.crypto_idfp); - e.crypto_idfp = self.crypto_idfp; + e.crypto_idfp = strzone(self.crypto_idfp); print_to(self, "^2SANDBOX - INFO: ^7Object claimed successfully"); }