Viikuna
No Marlo no game.
- Reaction score
- 265
Actually, bound sentinel does the job. You just gotta modify it a bit for your map, so it can for example, call destroy methods for your projectiles and stuff like that.
JASS:public constant rect WORLD = GetWorldBounds() //! runtextmacro BOUNDS_BUFFER() public constant real MAX_X = GetRectMaxX(WORLD) - BUFFER public constant real MIN_X = GetRectMinX(WORLD) + BUFFER public constant real MAX_Y = GetRectMaxY(WORLD) - BUFFER public constant real MIN_Y = GetRectMinY(WORLD) + BUFFER
WRONG. Unconstantize those, or the optimizer will inline them and you get mass leaks and lose efficiency.
constant trigger MyTrigger = CreateTrigger()
call TriggerRegisterTimerEvent(MyTrigger, ...) // For instance..
call TriggerRegisterTimerEvent(CreateTrigger(), ...)
Why don't you use the native IsPointInRegion(whichregion, x, y)
I think it would be faster that way.
set Region = CreateRegion()
call RegionAddRect(Region, bj_mapInitialPlayableArea)
// Then after....
if IsPointInRegion(Region, whichX, whichY) then
endif
IsPointInRegion(WorldRegion, x, 0.)
IsPointInRegion(WorldRegion, 0., y)
public region WorldReg = CreateRegion()
Public makes them fairly safe from conflict, and there's no real reason that map bound variables shouldn't be used directly, especially since there aren't wrappers to return them.Why are these public variables?
You'd rather make them private, no?
No objections, graveyarded.I'm currently intending to graveyard this soon.
...
The right way to do this is put BoundSentinel into your map. Should rip it off and make it use world bounds or something instead.
Checking the safety before moving the unit is just the wrong way to do it.