aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-01 07:50:28 +0000
committerEugene Sandulenko2004-08-01 07:50:28 +0000
commit6a2e05edb8ac8c1e1cdbcfdcc9d42dcf2a2584c9 (patch)
treebec36bbad59b1adf653927d5aef142fd10230deb
parent890d66708732ffd5b8d952c7b5831745bd0418d5 (diff)
downloadscummvm-rg350-6a2e05edb8ac8c1e1cdbcfdcc9d42dcf2a2584c9.tar.gz
scummvm-rg350-6a2e05edb8ac8c1e1cdbcfdcc9d42dcf2a2584c9.tar.bz2
scummvm-rg350-6a2e05edb8ac8c1e1cdbcfdcc9d42dcf2a2584c9.zip
More tweaks
svn-id: r14413
-rw-r--r--saga/actionmap.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/saga/actionmap.cpp b/saga/actionmap.cpp
index 3410db91cd..055a5100b5 100644
--- a/saga/actionmap.cpp
+++ b/saga/actionmap.cpp
@@ -42,6 +42,11 @@ int ActionMap::reg(void) {
ActionMap::ActionMap(void) {
debug(0, "ACTIONMAP Module: Initializing...");
+
+ _exits_loaded = 0;
+ _exits_tbl = NULL;
+ _n_exits = 0;
+
_initialized = true;
}
@@ -120,16 +125,17 @@ int ActionMap::freeMap(void) {
return R_SUCCESS;
}
- for (i = 0; i < _n_exits; i++) {
- exmap_entry = &_exits_tbl[i];
+ if (_exits_tbl) {
+ for (i = 0; i < _n_exits; i++) {
+ exmap_entry = &_exits_tbl[i];
- if (_exits_tbl[i])
- if (exmap_entry->pt_tbl)
- free(exmap_entry->pt_tbl);
- }
+ if (exmap_entry != NULL)
+ if (exmap_entry->pt_tbl)
+ free(exmap_entry->pt_tbl);
+ }
- if (_exits_tbl)
free(_exits_tbl);
+ }
_exits_loaded = 0;
_exits_tbl = NULL;