Skip to content

Commit e7337be

Browse files
committed
Code edit to the previous commit
1 parent 0fe319a commit e7337be

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sfall/Modules/Elevators.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ static void ElevatorsInit() {
136136
static long __fastcall Check4EscKey(long type, long map) {
137137
fo::ElevatorExit* exits = (Inited) ? elevatorExits[type] : fo::var::retvals[type];
138138
long elev = fo::var::map_elevation;
139-
long i = 0;
140-
do {
141-
if (exits[i].id == map && exits[i].elevation == elev) break;
142-
} while (++i < exitsPerElevator);
143-
144-
return i; // exit index
139+
for (long i = 0; i < exitsPerElevator; i++) {
140+
if (exits[i].id == map && exits[i].elevation == elev) {
141+
return i; // exit index
142+
}
143+
}
144+
return 0;
145145
}
146146

147147
static __declspec(naked) void elevator_select_hack() {

0 commit comments

Comments
 (0)