Merge branch 'maint'
This commit is contained in:
commit
33ee8f9fef
6 changed files with 74 additions and 6 deletions
|
|
@ -575,11 +575,7 @@ int ACSStringPool::InsertString(FString &str, unsigned int h, unsigned int bucke
|
|||
}
|
||||
else
|
||||
{ // Scan for the next free entry
|
||||
unsigned int i;
|
||||
for (i = FirstFreeEntry + 1; i < Pool.Size() && Pool[i].Next != FREE_ENTRY; ++i)
|
||||
{
|
||||
}
|
||||
FirstFreeEntry = i;
|
||||
FindFirstFreeEntry(FirstFreeEntry + 1);
|
||||
}
|
||||
PoolEntry *entry = &Pool[index];
|
||||
entry->Str = str;
|
||||
|
|
@ -590,6 +586,23 @@ int ACSStringPool::InsertString(FString &str, unsigned int h, unsigned int bucke
|
|||
return index | STRPOOL_LIBRARYID_OR;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// ACSStringPool :: FindFirstFreeEntry
|
||||
//
|
||||
// Finds the first free entry, starting at base.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
void ACSStringPool::FindFirstFreeEntry(unsigned base)
|
||||
{
|
||||
while (base < Pool.Size() && Pool[base].Next != FREE_ENTRY)
|
||||
{
|
||||
base++;
|
||||
}
|
||||
FirstFreeEntry = base;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// ACSStringPool :: ReadStrings
|
||||
|
|
@ -638,6 +651,7 @@ void ACSStringPool::ReadStrings(PNGHandle *png, DWORD id)
|
|||
{
|
||||
delete[] str;
|
||||
}
|
||||
FindFirstFreeEntry(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -690,6 +704,7 @@ void ACSStringPool::Dump() const
|
|||
Printf("%4u. (%2d) \"%s\"\n", i, Pool[i].LockCount, Pool[i].Str.GetChars());
|
||||
}
|
||||
}
|
||||
Printf("First free %u\n", FirstFreeEntry);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
@ -8405,7 +8420,7 @@ scriptwait:
|
|||
{
|
||||
int playernum = STACK(1);
|
||||
|
||||
if (playernum < 0 || playernum >= MAXPLAYERS || !playeringame[playernum] || players[playernum].camera == NULL)
|
||||
if (playernum < 0 || playernum >= MAXPLAYERS || !playeringame[playernum] || players[playernum].camera == NULL || players[playernum].camera->player != NULL)
|
||||
{
|
||||
STACK(1) = -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue