aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game/savepoint.h
diff options
context:
space:
mode:
authorEvgeny Grechnikov2018-08-25 15:11:24 +0300
committerEugene Sandulenko2018-08-26 12:09:43 +0200
commitf771fa40ad474d78d32ce5bff67afc937547e5de (patch)
tree483ee750c81169142fc58a68e87d5a321a4a96f3 /engines/lastexpress/game/savepoint.h
parentf3cb1fcd84d7ca1dd25b7adb4b54f08c535008ac (diff)
downloadscummvm-rg350-f771fa40ad474d78d32ce5bff67afc937547e5de.tar.gz
scummvm-rg350-f771fa40ad474d78d32ce5bff67afc937547e5de.tar.bz2
scummvm-rg350-f771fa40ad474d78d32ce5bff67afc937547e5de.zip
LASTEXPRESS: multiple fixes in NPC logic
Checked the logic against the original game (to be precise, DOS English version from GOG, although I think AI logic has no significant differences with other versions). Fixed a *lot* of errors with varying visibility for the user. Also, save+exit+load sometimes resulted in memory corruption like ((EntityParametersSSII*)(new EntityParametersIIII))->param8 = 0; load operation did not restore the correct type of NPC logic context, the default one was used (which also has the smallest sizeof). Should be fixed now. Save+load is still unusable because it locks everybody waiting for kActionEndSound (the sound state is not restored), but, at least, it should not corrupt the memory. Hopefully.
Diffstat (limited to 'engines/lastexpress/game/savepoint.h')
-rw-r--r--engines/lastexpress/game/savepoint.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/lastexpress/game/savepoint.h b/engines/lastexpress/game/savepoint.h
index ab6490796b..ea73e7c25d 100644
--- a/engines/lastexpress/game/savepoint.h
+++ b/engines/lastexpress/game/savepoint.h
@@ -58,7 +58,7 @@ struct SavePoint {
EntityIndex entity2;
union {
uint32 intValue;
- char charValue[5];
+ char charValue[7]; // "MUS%03d" with terminating zero
} param;
SavePoint() {
@@ -66,6 +66,7 @@ struct SavePoint {
action = kActionNone;
entity2 = kEntityPlayer;
param.intValue = 0;
+ param.charValue[6] = 0;
}
Common::String toString() {