Skip to content

Commit

Permalink
Merge pull request #439 from Mefiresu/asan-fixes
Browse files Browse the repository at this point in the history
AddressSanitizer fixes
  • Loading branch information
Leonx254 authored Oct 25, 2024
2 parents 7e4626d + 3b70007 commit 8e2f5f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions RSDKv4/NativeObjects/PlayerSelectScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,14 @@ void PlayerSelectScreen_Main(void *objPtr)
SetGlobalVariableByName("starPostID", 0);
debugMode = false;

int charID = 0;
switch (self->playerID) {
case SAVESEL_SONIC: saveGame->files[saveSel->selectedButton - 1].characterID = 0; break;
case SAVESEL_TAILS: saveGame->files[saveSel->selectedButton - 1].characterID = 1; break;
case SAVESEL_KNUX: saveGame->files[saveSel->selectedButton - 1].characterID = 2; break;
case SAVESEL_ST: saveGame->files[saveSel->selectedButton - 1].characterID = 3; break;
case SAVESEL_SONIC: charID = 0; break;
case SAVESEL_TAILS: charID = 1; break;
case SAVESEL_KNUX: charID = 2; break;
case SAVESEL_ST: charID = 3; break;
}
InitStartingStage(STAGELIST_PRESENTATION, 0, saveGame->files[saveSel->selectedButton - 1].characterID);
InitStartingStage(STAGELIST_PRESENTATION, 0, charID);

CREATE_ENTITY(FadeScreen);
}
Expand Down
2 changes: 1 addition & 1 deletion RSDKv4/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void RemoveNativeObject(NativeEntityBase *entity)
#if !RETRO_USE_ORIGINAL_CODE
if (!entity)
return;
memcpy(&activeEntityList[entity->objectID], &activeEntityList[entity->objectID + 1], sizeof(int) * (NATIVEENTITY_COUNT - (entity->objectID + 2)));
memmove(&activeEntityList[entity->objectID], &activeEntityList[entity->objectID + 1], sizeof(int) * (NATIVEENTITY_COUNT - (entity->objectID + 2)));
--nativeEntityCount;
for (int i = entity->slotID; objectEntityBank[i].eventMain; ++i) objectEntityBank[i].objectID--;
#else
Expand Down

0 comments on commit 8e2f5f3

Please sign in to comment.