This commit is contained in:
Sebastian Bularca
2026-05-08 01:13:33 +02:00
4 changed files with 4 additions and 16 deletions

View File

@@ -120,7 +120,7 @@ namespace Nox.Game {
timeHandler ??= new TimeHandler(adventureSettings, adventureData, worldClock);
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs, adventureData);
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs);
partyMovementHandler ??= new PartyMovementHandler(
partyRef,
cameraController,

View File

@@ -6,15 +6,12 @@ namespace Nox.Game {
public class EncounterHandler {
private readonly ZoneSystem zoneSystem;
private readonly EncounterRegistry encounterRegistry;
private readonly AdventureData adventureData;
private readonly EncounterView encounterView;
private string previousZoneId;
private int previousDay;
public EncounterHandler(ZoneSystem zoneSystem, EncounterRegistry encounterRegistry, EncounterPrefabs encounterPrefabs, AdventureData adventureData) {
public EncounterHandler(ZoneSystem zoneSystem, EncounterRegistry encounterRegistry, EncounterPrefabs encounterPrefabs) {
this.zoneSystem = zoneSystem;
this.encounterRegistry = encounterRegistry;
this.adventureData = adventureData;
encounterView = new EncounterView(encounterPrefabs);
}
@@ -62,7 +59,7 @@ namespace Nox.Game {
if(currentZoneId != previousZoneId) {
if(!string.IsNullOrEmpty(currentZoneId)) {
Debug.Log($"Entered zone: {currentZoneId} (encounter: {zoneContext.encounterTableId}, safe: {zoneContext.isSafe})");
if(ResolveEncounter(zoneContext, currentZoneId, out var encounter)) {
if(ResolveEncounter(zoneContext, zoneContext.encounterTableId, out var encounter)) {
TriggerEncounter(encounter);
}
@@ -86,9 +83,7 @@ namespace Nox.Game {
}
public void CheckForEncounters(Vector3 position) {
if (adventureData.currentDay != previousDay) {
VerifyZones(position);
}
VerifyZones(position);
}
public void Tick() { }

View File

@@ -17,7 +17,6 @@ namespace Nox.Game {
private Vector3 targetPosition;
private bool shouldHover;
private MapLocation currentSelectedPoi;
private string previousZoneId;
private bool hasClicked;
private bool skipNextClick;