From 921394b24c268893cb33d41f7a926fdcb6678c19 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 25 May 2013 21:31:30 +0000 Subject: [PATCH] Fix: allow longer soldier names to be displayed git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6100 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface.cpp | 2 +- Tactical/Soldier Control.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index 3997dce4..c1f30767 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -1666,7 +1666,7 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID ) INT32 iBack; TILE_ELEMENT TileElem; CHAR16 *pStr; - CHAR16 NameStr[ 50 ]; + CHAR16 NameStr[ MAX_ENEMY_NAMES_CHARS ]; UINT16 usGraphicToUse = THIRDPOINTERS1; BOOLEAN fRaiseName = FALSE; BOOLEAN fDoName = TRUE; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 7cb6aef2..1a3515eb 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -16065,7 +16065,7 @@ void SOLDIERTYPE::SwitchWeapons( BOOLEAN fKnife, BOOLEAN fSideArm ) } UINT8 tmpuser = 0; -static CHAR16 tmpname[2][ 100 ]; // we need 2 arrays, in case we need 2 name pointers in one string +static CHAR16 tmpname[2][ MAX_ENEMY_NAMES_CHARS ]; // we need 2 arrays, in case we need 2 name pointers in one string STR16 SOLDIERTYPE::GetName() { ++tmpuser; @@ -16079,7 +16079,10 @@ STR16 SOLDIERTYPE::GetName() { INT8 type = this->GetSoldierProfileType(this->bTeam); if ( type > -1 ) + { wcscpy( tmpname[tmpuser], zSoldierProfile[type][this->usSoldierProfile].szName ); + tmpname[tmpuser][ MAX_ENEMY_NAMES_CHARS - 1 ] = '\0'; + } } return tmpname[tmpuser];