Repository navigation
Fix the warp exclusion in sub_6FC66260 - #250
Open
ResurrectedTrader wants to merge 1 commit into
Open
ResurrectedTrader wants to merge 1 commit into
ResurrectedTrader wants to merge 1 commit into
Conversation
sub_6FC66260 picks up to 20 random positions to place a monster. MOO set bSpawnMonster when a candidate was near a warp or the level's spawn point and only tried to place the monster in that case, so: - with the warp check off (a7 == 0) every candidate was rejected, - with it on, only candidates next to a warp were accepted, - a candidate near the spawn point broke out of the 20-attempt loop. 1.10f (D2Game.0x6FC66260): "a7 == 0" jumps straight to placement (0x6FC663D3); a candidate near a warp (0x6FC6643E) or near the spawn point (0x6FC664BE) jumps to the next attempt at 0x6FC66534; otherwise it falls through to placement at 0x6FC664C0. 1.14d is the same (Game.exe.0x54DC40, with the checks in CheckWarpSpawnCoords at 0x54DB50). Rename the flag bNearWarp, place only when it is clear, and keep trying after a near-spawn-point candidate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sub_6FC66260picks up to 20 random positions in a room to place a monster. Witha7set, it skips candidates that lie withinLevels.txtWarpDistof a warp or of the level's spawn point.MOO inverts that check. It initialises
bSpawnMonster = 0, sets it to 1 when the candidate is near a warp or the spawn point, and only places the monster when it is 1. So:a7 == 0, every candidate is rejected and the function always returns 0,a7 != 0, only candidates next to a warp or the spawn point are accepted,breaks out of the 20-attempt loop instead of trying the next one.1.10f
D2Game.0x6FC66260, from the candidate roll to the end of the loop ([esp+0x7c]isa7,[esp+0x44]the attempt counter,ebp/ebxthe candidate X / Y):1.14d
SPAWN_FindRandomPositionForMonster(Game.exe0x54DC40) moves both proximity tests into a helper,CheckWarpSpawnCoords(0x54DB50), which returns 1 when the candidate is near a warp or the spawn point:Change
Rename the flag
bNearWarp, place the monster only when it is clear, and drop thebreakafter a near-spawn-point candidate so the loop tries the next one. The inner warp-coordinate loop still stops at the first warp that is close enough.🤖 Generated with Claude Code