- bugfix (from build 529): IMPs have wrong voices

- bugfix: Multiple IMPs with same voice causes wrong data and CTDs. Now it is impossible to have multiple IMPs with the same voice. No more invalid IMP data with multiple imps (hopefully) ;)
- You can have a maximum number of 6 imps (3 women and 3 men). All have different voices
- If an IMP is cloned (90210, nickname) an unused voice is set. So we have correct data
- Prevent the user from selecting used voices in the IMP Voice selection screen


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@535 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2006-09-18 19:31:34 +00:00
parent b22b219e6e
commit 6f06b9ce78
18 changed files with 494 additions and 300 deletions
+79
View File
@@ -798,6 +798,85 @@ void IMPMainPageNotSelectableBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
return;
}
// WANNE NEW
INT32 GetFilledIMPSlots( INT8 iSex )
{
INT32 i;
INT32 iCount = 0;
INT32 iStart;
INT32 iEnd;
// Only count the free imp male slots
if (iSex == MALE)
{
iStart = PLAYER_GENERATED_CHARACTER_ID;
iEnd = iStart + 3;
}
// Only count the free imp female slots
else if (iSex == FEMALE)
{
iStart = PLAYER_GENERATED_CHARACTER_ID + 3;
iEnd = iStart + 3;
}
// Count all free imp slots
else
{
iStart = PLAYER_GENERATED_CHARACTER_ID;
iEnd = PLAYER_GENERATED_CHARACTER_ID + 6;
}
for (i = iStart; i < iEnd; i++)
{
// We found a free slot
if (wcscmp(gMercProfiles[i].zName, L"") != 0)
{
iCount++;
}
}
// Return the number of free imp slots
return iCount;
}
// WANNE NEW
INT32 GetFreeIMPSlot(INT32 iIMPId)
{
INT32 iStart;
INT32 iEnd;
INT32 i;
INT32 iFreeSlot = -1;
if (iIMPId != -1)
{
// Female
if (iIMPId >= PLAYER_GENERATED_CHARACTER_ID + 3)
{
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;
}
}
}
return iFreeSlot;
}
BOOLEAN LoadCharacterPortraitForMainPage( void )
{