- Joined
- Jan 12, 2020
- Messages
- 5
Given an action like such:
Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing ...
(Center of (Playable map area)) will create a point which will not be garbage collected, as I understand it.
Therefore, most tutorials will recommend the following explicit action:
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing ...
script: call RemoveLocation (udg_Temp_Point)
Question:
Would this be sufficient/preferred to the above leak protection?
Hashtable - Save (Center of (Playable map area)) as 1 of Key(This Trigger) in GameProperties
Unit - Create 1 Footman for Player 1 (Red) at (Load 1 of Key(This Trigger)) facing Default building facing ...
It's one less line of "code" but is it better?
Edit: in fact, does this actually avoid a leak?
Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing ...
(Center of (Playable map area)) will create a point which will not be garbage collected, as I understand it.
Therefore, most tutorials will recommend the following explicit action:
Set Temp_Point = (Center of (Playable map area))
Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing ...
script: call RemoveLocation (udg_Temp_Point)
Question:
Would this be sufficient/preferred to the above leak protection?
Hashtable - Save (Center of (Playable map area)) as 1 of Key(This Trigger) in GameProperties
Unit - Create 1 Footman for Player 1 (Red) at (Load 1 of Key(This Trigger)) facing Default building facing ...
It's one less line of "code" but is it better?
Edit: in fact, does this actually avoid a leak?
Last edited: