Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 2d33418df1f2d0f439541f8b18255332a55c128c 1 parent 6356fb7
fizzet fizzet authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 gemrb/core/Map.cpp
10 gemrb/core/Map.cpp
View
@@ -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;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.