Skip to content

Commit

Permalink
Fix race condition causing UV remapping to fail in battle (closes #1827)
Browse files Browse the repository at this point in the history
  • Loading branch information
LordMonoxide committed Dec 11, 2024
1 parent 71d2970 commit a4c7088
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/main/java/legend/game/combat/Battle.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@
import static legend.game.combat.environment.BattleCamera.UPDATE_REFPOINT;
import static legend.game.combat.environment.BattleCamera.UPDATE_VIEWPOINT;
import static legend.game.combat.environment.StageData.getEncounterStageData;
import static legend.game.combat.environment.StageData.stageData_80109a98;

public class Battle extends EngineState {
private static final Logger LOGGER = LogManager.getFormatterLogger(Battle.class);
Expand Down Expand Up @@ -2088,14 +2087,15 @@ public int addCombatant(final int a0, final int charSlot) {

if(charSlot < 0) {
combatant.flags_19e = 0x1;
combatant.vramSlot_1a0 = this.findFreeMonsterTextureSlot(a0);
} else {
//LAB_800c8f90
combatant.flags_19e = 0x5;
combatant.vramSlot_1a0 = charSlot + 1;
}

//LAB_800c8f94
combatant.charSlot_19c = charSlot;
combatant.vramSlot_1a0 = 0;
combatant.charIndex_1a2 = a0;
combatant._1a4 = -1;
combatant._1a6 = -1;
Expand Down Expand Up @@ -2617,18 +2617,6 @@ public void loadCombatantTim(@Nullable final CombatantStruct1a8 combatant, final
final int vramSlot;

if(combatant != null) {
//LAB_800ca77c
if(combatant.vramSlot_1a0 == 0) {
final int charSlot = combatant.charSlot_19c;

if(charSlot < 0) {
combatant.vramSlot_1a0 = this.findFreeMonsterTextureSlot(combatant.charIndex_1a2);
} else {
//LAB_800ca7c4
combatant.vramSlot_1a0 = charSlot + 1;
}
}

vramSlot = combatant.vramSlot_1a0;
} else {
vramSlot = 0;
Expand Down

0 comments on commit a4c7088

Please sign in to comment.