aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/floor.cpp
diff options
context:
space:
mode:
authorSimei Yin2017-08-22 14:12:54 +0200
committerSimei Yin2017-08-22 16:20:15 +0200
commit867b8dbb9277f2cde6c45c107b15edd1a6f73b10 (patch)
tree097902d2165356328e7b5e86f961c2d69fdbbfbd /engines/sludge/floor.cpp
parent4783541529988e2872fea27565d92d2c36d03f7a (diff)
downloadscummvm-rg350-867b8dbb9277f2cde6c45c107b15edd1a6f73b10.tar.gz
scummvm-rg350-867b8dbb9277f2cde6c45c107b15edd1a6f73b10.tar.bz2
scummvm-rg350-867b8dbb9277f2cde6c45c107b15edd1a6f73b10.zip
SLUDGE: Reset engine when launching a new game data file
Diffstat (limited to 'engines/sludge/floor.cpp')
-rw-r--r--engines/sludge/floor.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/sludge/floor.cpp b/engines/sludge/floor.cpp
index dff6980c7c..45a7501470 100644
--- a/engines/sludge/floor.cpp
+++ b/engines/sludge/floor.cpp
@@ -105,16 +105,18 @@ bool initFloor() {
}
void killFloor() {
- for (int i = 0; i < currentFloor->numPolygons; i++) {
- delete []currentFloor->polygon[i].vertexID;
- delete []currentFloor->matrix[i];
+ if (currentFloor) {
+ for (int i = 0; i < currentFloor->numPolygons; i++) {
+ delete []currentFloor->polygon[i].vertexID;
+ delete []currentFloor->matrix[i];
+ }
+ delete []currentFloor->polygon;
+ currentFloor->polygon = NULL;
+ delete []currentFloor->vertex;
+ currentFloor->vertex = NULL;
+ delete []currentFloor->matrix;
+ currentFloor->matrix = NULL;
}
- delete []currentFloor->polygon;
- currentFloor->polygon = NULL;
- delete []currentFloor->vertex;
- currentFloor->vertex = NULL;
- delete []currentFloor->matrix;
- currentFloor->matrix = NULL;
}
void setFloorNull() {