mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- bugfix: When loading an I.M.P by nickname or 90210 the voice was not set correct
- feature: Now it is possible to load an I.M.P. even if it has multiple blanks (spaces) in the nickname. E.g. "Mr D 2", "Jack 1", ... git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@559 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -767,7 +767,7 @@ BOOLEAN LoadImpCharacter( STR nickName )
|
||||
}
|
||||
|
||||
// Set the ID of the new IMP
|
||||
iProfileId = GetFreeIMPSlot(iProfileId);
|
||||
iProfileId = GetFreeIMPSlot(iProfileId, iProfileId);
|
||||
|
||||
// We can create the new imp, beacuse we found an empty slot
|
||||
if (iProfileId != -1)
|
||||
|
||||
@@ -339,7 +339,7 @@ void HandleTextEvent( UINT32 uiKey )
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
uiKey >= 'a' && uiKey <= 'z' ||
|
||||
uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' || uiKey == '.' )
|
||||
uiKey == '_' || uiKey == '.' || uiKey ==' ') // WANNE NEW: added ' '
|
||||
{
|
||||
// if the current string position is at max or great, do nothing
|
||||
if( iStringPos >= 8 )
|
||||
|
||||
+32
-17
@@ -839,36 +839,51 @@ INT32 GetFilledIMPSlots( INT8 iSex )
|
||||
}
|
||||
|
||||
// WANNE NEW
|
||||
INT32 GetFreeIMPSlot(INT32 iIMPId)
|
||||
INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId)
|
||||
{
|
||||
INT32 iStart;
|
||||
INT32 iEnd;
|
||||
INT32 i;
|
||||
INT32 iFreeSlot = -1;
|
||||
BOOLEAN bFoundDefaultIMP = FALSE;
|
||||
|
||||
if (iIMPId != -1)
|
||||
{
|
||||
// Female
|
||||
if (iIMPId >= PLAYER_GENERATED_CHARACTER_ID + 3)
|
||||
// We have a default imp id (90210 or nickname)
|
||||
if (iDefaultIMPId != -1)
|
||||
{
|
||||
iStart = PLAYER_GENERATED_CHARACTER_ID + 3;
|
||||
iEnd = PLAYER_GENERATED_CHARACTER_ID + 6;
|
||||
}
|
||||
// Male
|
||||
else
|
||||
{
|
||||
iStart = PLAYER_GENERATED_CHARACTER_ID;
|
||||
iEnd = PLAYER_GENERATED_CHARACTER_ID + 3;
|
||||
if (wcscmp(gMercProfiles[iDefaultIMPId].zName, L"") == 0)
|
||||
{
|
||||
iFreeSlot = iDefaultIMPId;
|
||||
return iFreeSlot;
|
||||
}
|
||||
}
|
||||
|
||||
// Find a free imp slot
|
||||
for (i = iStart; i < iEnd; i++)
|
||||
// The default IMP id is already used, find next free imp id
|
||||
if (bFoundDefaultIMP == FALSE)
|
||||
{
|
||||
// Found a free imp slot
|
||||
if (wcscmp(gMercProfiles[i].zName, L"") == 0)
|
||||
// Female
|
||||
if (iIMPId >= PLAYER_GENERATED_CHARACTER_ID + 3)
|
||||
{
|
||||
iFreeSlot = i;
|
||||
break;
|
||||
iStart = PLAYER_GENERATED_CHARACTER_ID + 3;
|
||||
iEnd = PLAYER_GENERATED_CHARACTER_ID + 6;
|
||||
}
|
||||
// Male
|
||||
else
|
||||
{
|
||||
iStart = PLAYER_GENERATED_CHARACTER_ID;
|
||||
iEnd = PLAYER_GENERATED_CHARACTER_ID + 3;
|
||||
}
|
||||
|
||||
// Find a free imp slot
|
||||
for (i = iStart; i < iEnd; i++)
|
||||
{
|
||||
// Found a free imp slot
|
||||
if (wcscmp(gMercProfiles[i].zName, L"") == 0)
|
||||
{
|
||||
iFreeSlot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void NextProfilingMode( void );
|
||||
void ShadeUnSelectableButtons( void );
|
||||
|
||||
// WANNE NEW
|
||||
INT32 GetFreeIMPSlot(INT32 iIMPId);
|
||||
INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId);
|
||||
INT32 GetFilledIMPSlots( INT8 iSex );
|
||||
|
||||
extern INT32 iCurrentProfileMode;
|
||||
|
||||
Reference in New Issue
Block a user