Page 1 of 1

Mistake in cSpawnRegion.cpp

Posted: Tue Jun 07, 2005 3:16 pm
by Grimson
I just looke through to cSpawnRegion.cpp to see why UOX tends to spawn one more item/npc than the maximum set in the spawns.dfn, and found the following at line 402ff:

Code: Select all

bool shouldSpawnChars = ( !sNpcs.empty() && maxcspawn >= spawnedChars.Num() );
bool shouldSpawnItems = ( !sItems.empty() && maxispawn >= spawnedItems.Num() );
This is wrong, because it will allow another spawn when the number of already spawned items/npcs is equal to the maximum setting. It should be:

Code: Select all

bool shouldSpawnChars = ( !sNpcs.empty() && maxcspawn > spawnedChars.Num() );
bool shouldSpawnItems = ( !sItems.empty() && maxispawn > spawnedItems.Num() );

Posted: Tue Jun 07, 2005 5:30 pm
by Xuri
Bugfix tested and verified, so I'll upload it to the cvs. Nice work! =)