Embark on an epic journey to make both the game and the two editors load the entire scenario into memory.
Some other tweaks and fixes got pulled in along the way. Details: - Improved const-correctness - The scenario is now part of the universe, so now there's no global scenario object in the game or the PC editor. (Of course, the scenario editor has no universe, so it still has a global scenario object.) - Towns and outdoors now store a reference to the scenario; the party, current town, and current outdoors store a reference to the universe. Altogether this means that the data module has no need for global scenario or universe objects. - The fileio routines now take a scenario or universe reference as a parameter, so they don't need the global scenario or universe objects either. - cCurOut now has an arrow operator for accessing the current outdoor section, instead of a 2x2 subset of the outdoors; this replaces using i_w_c to index the 2x2 subset. (And it's much less verbose!) - cCurTown no longer stores a pointer to the town record, since it can simply access it through the universe instance which it stores a reference to. - Tweaked how the monster roster menu works (it now caches up to 60 monsters) - The operator= functions that convert from legacy to new scenario/save format are now ordinary functions rather than operators. - The bizarre use of assigning a cCreature to itself to populate certain fields has been nuked. - When at the corner of an outdoor sector, the scenario editor now shows the cornermost terrain in the diagonally adjacent sector. - There was a missing check to prevent horses entering dangerous terrain (eg, swamp) while in town. - Fix cancelling load party dialog causing a party to appear
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <array>
|
||||
#include "universe.h"
|
||||
#include "scenario.h"
|
||||
#include "boe.party.h"
|
||||
#include "boe.infodlg.h"
|
||||
#include "boe.consts.h"
|
||||
@@ -22,7 +21,6 @@ extern short on_monst_menu[256];
|
||||
extern bool party_in_memory;
|
||||
extern short current_pc;
|
||||
extern cUniverse univ;
|
||||
extern cScenario scenario;
|
||||
extern eGameMode overall_mode;
|
||||
|
||||
#ifndef __APPLE__
|
||||
@@ -90,11 +88,11 @@ void adjust_monst_menu() {
|
||||
}
|
||||
for(i = 0; i < 256; i++) {
|
||||
if(on_monst_menu[i] >= 0) {
|
||||
std::string monst_name = scenario.scen_monsters[on_monst_menu[i]].m_name;
|
||||
std::string monst_name = univ.scenario.scen_monsters[on_monst_menu[i]].m_name;
|
||||
NSString* str = [NSString stringWithUTF8String: monst_name.c_str()];
|
||||
NSMenuItem* newItem = [monst_menu addItemWithTitle: str action: @selector(monstMenu:) keyEquivalent: @""];
|
||||
[newItem setTarget: targ];
|
||||
[newItem setRepresentedObject: [MonsterWrapper withMonster: scenario.scen_monsters[on_monst_menu[i]]]];
|
||||
[newItem setRepresentedObject: [MonsterWrapper withMonster: univ.scenario.scen_monsters[on_monst_menu[i]]]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user