aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorD G Turner2019-09-14 02:00:16 +0100
committerD G Turner2019-09-14 02:01:57 +0100
commit7064698b6058873118a4cf7d561611161e1c7f13 (patch)
treeb7e006d1ac7606a10000e4491217a975df7d9e18 /engines/hdb
parent4780454c221227aa85e7773b0a463e0a92d73226 (diff)
downloadscummvm-rg350-7064698b6058873118a4cf7d561611161e1c7f13.tar.gz
scummvm-rg350-7064698b6058873118a4cf7d561611161e1c7f13.tar.bz2
scummvm-rg350-7064698b6058873118a4cf7d561611161e1c7f13.zip
HDB: Removed Fixed String Buffer from AI Player Code
This is replaced by simpler Common::String equivalent.
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-player.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/engines/hdb/ai-player.cpp b/engines/hdb/ai-player.cpp
index 84bfa8e506..70e527fe3f 100644
--- a/engines/hdb/ai-player.cpp
+++ b/engines/hdb/ai-player.cpp
@@ -1581,8 +1581,6 @@ void aiTransceiverUse(AIEntity *e) {
}
#endif
-char monkBuff[32];
-
void aiMonkeystoneInit(AIEntity *e) {
e->aiUse = aiMonkeystoneUse;
e->aiAction = aiMonkeystoneAction;
@@ -1608,12 +1606,9 @@ void aiMonkeystoneInit2(AIEntity *e) {
void aiMonkeystoneUse(AIEntity *e) {
int val = g_hdb->_ai->getMonkeystoneAmount();
- sprintf(monkBuff, "You have %d Monkeystone", val);
- if (val > 1)
- strcat(monkBuff, "s");
- strcat(monkBuff, "!");
+ Common::String monkString = Common::String::format("You have %d Monkeystone%s!", val, (val > 1) ? "s" : "");
g_hdb->_sound->playSound(SND_GET_MONKEYSTONE);
- g_hdb->_window->openMessageBar(monkBuff, kMsgDelay);
+ g_hdb->_window->openMessageBar(monkString.c_str(), kMsgDelay);
// have we unlocked a secret star(tm)???
if (val == 7) {