aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-22 22:19:41 +0530
committerEugene Sandulenko2019-09-03 17:16:55 +0200
commitd1a48b9d6f43fb5a69eb474dc509c3dcd49253b1 (patch)
tree40ebc3a6e2ec77a36242c448621bfa9a6ed7fa4b
parent2b2d37502716ac3b22e507282e3000693d3c3563 (diff)
downloadscummvm-rg350-d1a48b9d6f43fb5a69eb474dc509c3dcd49253b1.tar.gz
scummvm-rg350-d1a48b9d6f43fb5a69eb474dc509c3dcd49253b1.tar.bz2
scummvm-rg350-d1a48b9d6f43fb5a69eb474dc509c3dcd49253b1.zip
HDB: Fix CineCommand string and title values
-rw-r--r--engines/hdb/ai-cinematic.cpp12
-rw-r--r--engines/hdb/ai.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp
index 46754e17d5..819b9e2c5b 100644
--- a/engines/hdb/ai-cinematic.cpp
+++ b/engines/hdb/ai-cinematic.cpp
@@ -210,14 +210,14 @@ void AI::processCines() {
}
case C_USEENTITY:
for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) {
- if (Common::matchString((*it)->entityName, _cine[i]->string)) {
+ if ((*it)->entityName && Common::matchString((*it)->entityName, _cine[i]->string)) {
g_hdb->useEntity((*it));
}
}
warning("STUB: PROCESSCINES: USEENTITY: CheckActionList required;");
#if 0
for (int i = 0;i < kMaxAutoActions;i++) {
- if (Common::matchString(_autoActions[i].entityName, _cine[i]->string) && !_autoActions[i].activated)
+ if (_autoActions[i].entityName && Common::matchString(_autoActions[i].entityName, _cine[i]->string) && !_autoActions[i].activated)
checkAutoList(&_dummyPlayer, _autoActions[i].x, _autoActions[i].y);
}
#endif
@@ -335,7 +335,7 @@ void AI::cineWaitUntilDone() {
void AI::cineSetEntity(const char *entName, int x, int y, int level) {
CineCommand *cmd = new CineCommand;
- cmd->string = entName;
+ strcpy(cmd->string, entName);
cmd->x = x * kTileWidth;
cmd->y = y * kTileHeight;
cmd->x2 = level;
@@ -350,14 +350,14 @@ void AI::cineMoveEntity(const char *entName, int x, int y, int level, int speed)
cmd->x2 = level;
cmd->start = 0;
cmd->speed = speed;
- cmd->title = entName;
+ strcpy(cmd->title, entName);
cmd->cmdType = C_MOVEENTITY;
_cine.push_back(cmd);
}
void AI::cineEntityFace(const char *luaName, double dir) {
CineCommand *cmd = new CineCommand;
- cmd->title = luaName;
+ strcpy(cmd->title, luaName);
cmd->x = dir;
cmd->cmdType = C_ENTITYFACE;
_cine.push_back(cmd);
@@ -365,7 +365,7 @@ void AI::cineEntityFace(const char *luaName, double dir) {
void AI::cineUse(const char *entName) {
CineCommand *cmd = new CineCommand;
- cmd->string = entName;
+ strcpy(cmd->string, entName);
cmd->cmdType = C_USEENTITY;
_cine.push_back(cmd);
}
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 2a1206107e..012ed91282 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -590,13 +590,13 @@ struct CineCommand {
int start, end;
uint32 delay;
int speed;
- const char *title;
- const char *string;
+ char title[32];
+ char string[32];
char *id;
AIEntity *e;
CineCommand() : cmdType(C_NO_COMMAND), x(0.0), y(0.0), x2(0.0), y2(0.0), xv(0.0), yv(0.0),
- start(0), end(0), delay(0), speed(0), title(NULL), string(NULL), id(NULL), e(NULL) {}
+ start(0), end(0), delay(0), speed(0), title(""), string(""), id(NULL), e(NULL) {}
};
#define onEvenTile(x, y) ( !(x & 31) && !(y & 31) )