We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fe319a commit e7337beCopy full SHA for e7337be
1 file changed
sfall/Modules/Elevators.cpp
@@ -136,12 +136,12 @@ static void ElevatorsInit() {
136
static long __fastcall Check4EscKey(long type, long map) {
137
fo::ElevatorExit* exits = (Inited) ? elevatorExits[type] : fo::var::retvals[type];
138
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
+ for (long i = 0; i < exitsPerElevator; i++) {
+ if (exits[i].id == map && exits[i].elevation == elev) {
+ return i; // exit index
+ }
+ return 0;
145
}
146
147
static __declspec(naked) void elevator_select_hack() {
0 commit comments