RCS file: /cvsroot/scummvm/scummvm/gob/goblin.cpp,v
retrieving revision 1.19
diff -u -r1.19 goblin.cpp
|
|
|
2387 | 2387 | int16 layer; |
2388 | 2388 | int16 state; |
2389 | 2389 | int32 *retVarPtr; |
| 2390 | bool objDescSet = false; |
2390 | 2391 | |
2391 | 2392 | retVarPtr = (int32 *)VAR_ADDRESS(59); |
2392 | 2393 | |
… |
… |
|
2395 | 2396 | if (cmd > 0 && cmd < 17) { |
2396 | 2397 | extraData = inter_load16(); |
2397 | 2398 | objDesc = gob_objects[extraData]; |
| 2399 | objDescSet = true; |
2398 | 2400 | extraData = inter_load16(); |
2399 | 2401 | } |
2400 | 2402 | |
2401 | 2403 | if (cmd > 90 && cmd < 107) { |
2402 | 2404 | extraData = inter_load16(); |
2403 | 2405 | objDesc = gob_goblins[extraData]; |
| 2406 | objDescSet = true; |
2404 | 2407 | extraData = inter_load16(); |
2405 | 2408 | cmd -= 90; |
2406 | 2409 | } |
… |
… |
|
2408 | 2411 | if (cmd > 110 && cmd < 128) { |
2409 | 2412 | extraData = inter_load16(); |
2410 | 2413 | objDesc = gob_goblins[extraData]; |
| 2414 | objDescSet = true; |
2411 | 2415 | cmd -= 90; |
2412 | 2416 | } else if (cmd > 20 && cmd < 38) { |
2413 | 2417 | extraData = inter_load16(); |
2414 | 2418 | objDesc = gob_objects[extraData]; |
| 2419 | objDescSet = true; |
2415 | 2420 | } |
2416 | 2421 | |
2417 | | if (cmd < 40 && objDesc == 0) |
| 2422 | /* |
| 2423 | NB: The original gobliiins engine did not initialize the objDesc |
| 2424 | variable, so we manually check if objDesc is properly set before |
| 2425 | checking if it is zero. If it was not set, we do not return. This |
| 2426 | fixes a crash in the EGA version if the life bar is depleted, because |
| 2427 | gob_interFunc is called multiple times with cmd == 39. |
| 2428 | Bug #1324814 |
| 2429 | */ |
| 2430 | |
| 2431 | |
| 2432 | if (cmd < 40 && objDescSet && objDesc == 0) |
2418 | 2433 | return; |
2419 | 2434 | |
2420 | 2435 | debug(5, "cmd = %d", cmd); |