X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Feffects%2Fqc%2Fglobalsound.qc;h=8c0dfd5080312fda7d1ed4d10a66a108bdd34075;hb=8639f042c5ef61287b2f7e0dbf17f8c08a2c0ebf;hp=874c64d5385755189e04766de0279a726cdbb70d;hpb=f1ead602997113ae2cb58dbd08ce456e5c712b3b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index 874c64d538..8c0dfd5080 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -42,9 +42,7 @@ WriteByte(channel, floor(_atten * 64)); entcs_force_origin(from); vector o = from.origin + 0.5 * (from.mins + from.maxs); - WriteCoord(channel, o.x); - WriteCoord(channel, o.y); - WriteCoord(channel, o.z); + WriteVector(channel, o); } /** @@ -79,9 +77,7 @@ WriteByte(channel, floor(_atten * 64)); entcs_force_origin(from); vector o = from.origin + 0.5 * (from.mins + from.maxs); - WriteCoord(channel, o.x); - WriteCoord(channel, o.y); - WriteCoord(channel, o.z); + WriteVector(channel, o); } #endif @@ -97,10 +93,7 @@ int chan = ReadSByte(); float vol = ReadByte() / 255; float atten = ReadByte() / 64; - vector o; - o.x = ReadCoord(); - o.y = ReadCoord(); - o.z = ReadCoord(); + vector o = ReadVector(); // TODO: is this really what we want to be doing? Footsteps that follow the player at head height? if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume else if (e) e.origin = o; @@ -129,10 +122,7 @@ int chan = ReadSByte(); float vol = ReadByte() / 255; float atten = ReadByte() / 64; - vector o; - o.x = ReadCoord(); - o.y = ReadCoord(); - o.z = ReadCoord(); + vector o = ReadVector(); if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume else if (e) e.origin = o; if (e) @@ -247,8 +237,7 @@ .string fld = it.m_playersoundfld; if (this.(fld)) { - strunzone(this.(fld)); - this.(fld) = string_null; + strfree(this.(fld)); } }); } @@ -279,8 +268,7 @@ } string file = argv(1); string variants = argv(2); - if (this.(field)) strunzone(this.(field)); - this.(field) = strzone(strcat(file, " ", variants)); + strcpy(this.(field), strcat(file, " ", variants)); } fclose(fh); return true; @@ -294,8 +282,7 @@ void UpdatePlayerSounds(entity this) { if (this.model == this.model_for_playersound && this.skin == this.skin_for_playersound) return; - if (this.model_for_playersound) strunzone(this.model_for_playersound); - this.model_for_playersound = strzone(this.model); + strcpy(this.model_for_playersound, this.model); this.skin_for_playersound = this.skin; ClearPlayerSounds(this); LoadPlayerSounds(this, "sound/player/default.sounds", true);