HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

does Player Group - Player 1 (Red) leak?

09-22-2005, 03:13 AM#1
drdlord
does this leak a player group? or anything else for that matter, Income is an array of int.

I'm having MAJOR lag problems in my map and I need to find ANY lag causes to fix it. map is here

Quote:
Game - Display to Player Group - Player 1 (Red) for 10.00 seconds the text: (|c00ff0000Your Income:|r + (String(Income[(Player number of Player 1 (Red))])))
09-22-2005, 07:22 PM#2
Gandalf2349
I'm 90% sure it doesn't. The only things that leak are their custom object oriented variables.

Player Group - Player 1 (Red) is just passing it a constant.
09-24-2005, 02:08 PM#3
iNfraNe
Quote:
function GetForceOfPlayer takes player whichPlayer returns force
local force f = CreateForce()
call ForceAddPlayer(f, whichPlayer)
return f
endfunction
yes it leaks.
And yes, blizzard is stupid. (for not including display to player but stupid force)
09-24-2005, 06:50 PM#4
Anitarf
Quote:
Originally Posted by toot
Quote:
function GetForceOfPlayer takes player whichPlayer returns force
local force f = CreateForce()
call ForceAddPlayer(f, whichPlayer)
return f
endfunction
yes it leaks.
And yes, blizzard is stupid. (for not including display to player but stupid force)
That is true, however, "Player Group - Player 1 (Red)" is a preset group, when converted to custom text, it doesn't use GetForceOfPlayer(), but a global array bj_FORCE_PLAYER[0]. So, it doesn't create a new force object which would leak.

However, if you used "convert player to player group" function, that translates to GetForceOfPlayer() function, which now seems all the more stupid when you know that there already exists such a thing as bj_FORCE_PLAYER[].

So, using any of the "preset" options doesn't leak, while "variable" options in most cases do. "All Players" doesn't leak either, though, because GetPlayersAll() returns a constant: bj_FORCE_ALL_PLAYERS.
09-24-2005, 06:53 PM#5
iNfraNe
oh right, didnt know he was talking about preset stuff, ofcourse preset stuff doesnt leak :) read wrong. My bad