Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetUnitX / out of map boundary orders crash? #106

Open
Luashine opened this issue Sep 23, 2023 · 1 comment
Open

SetUnitX / out of map boundary orders crash? #106

Luashine opened this issue Sep 23, 2023 · 1 comment

Comments

@Luashine
Copy link
Collaborator

Luashine commented Sep 23, 2023

https://web.archive.org/web/20140213050502/http://www.wc3c.net/showthread.php?t=102576

Moving a unit outside the map's bounds using SetUnitX/Y will STILL crash the game. But I did not want to use a wrapper for SetUnitX/Y that does the bounds checking, an extra function call seems like killing the whole purpose of using SetUnitX/Y... Adding this library to your map (just adding it) [...]

Post 5:

Really, been testing:
Left/Right/Top edges do not crash.
Bottom edge crashes: However it doesn't crash at the instant you call SetUnitY, it crashes when the frame is rendered (apparently, could be another thing besides rendering...) so, yep this library really prevents crashes.
There is another thing with edges, regardless of the crash we knew about for so long, if you issue an order to a unit too far from the edges, the game will freeze, yep BoundSentinel prevents that as well.

Pages 2 and 3 were not archived.

Maybe no longer crashes on Reforged.

  1. SetUnitX/Y
  2. Order a unit too far out
  3. Test all directions

This resource is crashing the game during loading time on patch 1.31.1.

The following line is the culprit:call SetUnitY(dummy, GetRectMaxY(world) + 1000).
Removing the + 1000 fixed the issue.

@Luashine
Copy link
Collaborator Author

Under normal circumstances SetUnitX, IssuePointOrder will no longer crash. Units will be legit outside the map and not interact normally but it doesn't crash anymore. The below snippet is an extreme case and still does crash.

oob = CreateUnit(Player(0), FourCC("hfoo"), -30, 0, 90)
-- Either will crash the game within 1-2 seconds, 1.36.2.21230
-- math.mininteger, math.maxinteger
SetUnitX(oob, math.mininteger)
SetUnitY(oob, math.mininteger)

Idk how I would need to proceed. It'd be too much hassle to test all by hand so I'm short of writing like a fuzzer. Not exactly but even writing down all functions in a list by hand is tedious work. Then its either automation or nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant