diff options
author | D G Turner | 2019-09-14 02:00:16 +0100 |
---|---|---|
committer | D G Turner | 2019-09-14 02:01:57 +0100 |
commit | 7064698b6058873118a4cf7d561611161e1c7f13 (patch) | |
tree | b7e006d1ac7606a10000e4491217a975df7d9e18 /engines/hdb/ai-player.cpp | |
parent | 4780454c221227aa85e7773b0a463e0a92d73226 (diff) | |
download | scummvm-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/ai-player.cpp')
-rw-r--r-- | engines/hdb/ai-player.cpp | 9 |
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) { |