Permalink
Browse files

respect party level for spawn groups

If we don't exceed the difficulty threshold don't spawn more than one
creature.

Still need some empirical evidence to find out intended behaviour but
this should make some ridiculously hard encounters manageable at least.
  • Loading branch information...
1 parent 6356fb7 commit 2d33418df1f2d0f439541f8b18255332a55c128c @fizzet fizzet committed Apr 19, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 gemrb/core/Map.cpp
View
10 gemrb/core/Map.cpp
@@ -3018,7 +3018,11 @@ bool Map::SpawnCreature(const Point &pos, const char *creResRef, int radiusx, in
if (Spawns.Lookup(creResRef, lookup)) {
sg = (SpawnGroup *) lookup;
- count = sg->Count;
+ if (level >= (int) sg->Level) {
+ count = sg->Count;
+ } else if (!first) {
+ count = 0;
+ }
}
while (count--) {
@@ -3029,15 +3033,13 @@ bool Map::SpawnCreature(const Point &pos, const char *creResRef, int radiusx, in
//SpawnGroups normally are all or nothing but make sure we spawn
//at least one creature if this is the first
- if (level >= cpl || first) {
+ if (level >= cpl || sg || first) {
AddActor(creature, true);
creature->SetPosition(pos, true, radiusx, radiusy);
creature->RefreshEffects(NULL);
if (difficulty && !sg) *difficulty -= cpl;
if (creCount) (*creCount)++;
spawned = true;
- } else {
- break;
}
}
}

0 comments on commit 2d33418

Please sign in to comment.