Skip to content

Commit

Permalink
#135 Fix Obigrorn the Giant having riders
Browse files Browse the repository at this point in the history
  • Loading branch information
IcemarkUK committed Feb 7, 2023
1 parent d549525 commit 8bdf5c5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions main/midnight/src/tme/scenarios/ddr/ddr_scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,31 @@ MXTRACE("Place Objects On Map");
PlaceObjectsOnMap();

for (int ii = 0; ii < sv_characters; ii++) {
ddr_character* c = static_cast<ddr_character*>(mx->CharacterById(ii+1));
auto c = static_cast<ddr_character*>(mx->CharacterById(ii+1));
c->lastlocation=c->Location();
}

for ( int ii=0; ii < sv_strongholds; ii++ ) {
mxstronghold* s = static_cast<mxstronghold*>(mx->StrongholdById(ii+1));
auto s = static_cast<mxstronghold*>(mx->StrongholdById(ii+1));
s->MaxTroops(sv_stronghold_default_max);
s->MinTroops(sv_stronghold_default_min);
}

mxterrain* tinfo = mx->TerrainById(TN_ICYWASTE);
// Obigorn the giant starts with Riders and not Warriors
// this needs a data fix too
// https://github.com/ChilliHugger/The-Lords-Of-Midnight/issues/135
auto obigrorn = static_cast<ddr_character*>(mx->EntityByName("CH_OBIGRORN"));
if(obigrorn!=nullptr){
obigrorn->Flags().Reset(cf_allowedriders);
obigrorn->Flags().Set(cf_allowedwarriors);
obigrorn->warriors.Total(obigrorn->riders.Total());
obigrorn->warriors.Energy(obigrorn->riders.Energy());
obigrorn->warriors.Lost(obigrorn->riders.Lost());
obigrorn->warriors.Killed(obigrorn->riders.Killed());
obigrorn->riders.Total(0);
}

auto tinfo = mx->TerrainById(TN_ICYWASTE);
tinfo->movementcost=2;

mxscenario::initialiseAfterCreate(version);
Expand Down

0 comments on commit 8bdf5c5

Please sign in to comment.