diff options
| author | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
| commit | 9d4b799db4868bcab291b83599ff088763cd4ed6 (patch) | |
| tree | 252f0fcc779acf35243983d643d6399ee2e0cd0b /internal/game/core_login_char.go | |
| parent | d25638d98fe63efdeab570ef77e6a6a97f2d7a60 (diff) | |
| download | thehouseoficarus-9d4b799db4868bcab291b83599ff088763cd4ed6.tar.gz | |
feat: new type of non-violent 'combat': work
Diffstat (limited to 'internal/game/core_login_char.go')
| -rw-r--r-- | internal/game/core_login_char.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/internal/game/core_login_char.go b/internal/game/core_login_char.go index f0d6863..dec6dae 100644 --- a/internal/game/core_login_char.go +++ b/internal/game/core_login_char.go @@ -41,8 +41,8 @@ func (g *Game) handleNewCharName(sess *net.Session, input string) { } p := player.New(name) - p.RoomID = 1 - p.Stats.RecordRoomVisit(1) + p.RoomID = 1001 + p.Stats.RecordRoomVisit(1001) if err := g.AccountStore.SaveCharacter(p); err != nil { sess.WriteLine(fmt.Sprintf("Error creating character: %v", err)) @@ -101,6 +101,23 @@ func (g *Game) connectCharacter(sess *net.Session, name string) { g.doLook(sess) g.checkAggro(sess) + + // Resume an interrupted on_enter cutscene (e.g. disconnected mid-sequence). + // Only fires when a persisted marker matches the room the player is in, so + // ordinary on_enter scripts never run on login. + if p.CutsceneRoom != 0 { + if p.CutsceneRoom == p.RoomID { + g.runEnterSteps(sess, p.RoomID) + } + g.enterMu.Lock() + _, active := g.enterSeqs[p.Name] + g.enterMu.Unlock() + if !active { + p.CutsceneRoom = 0 + g.AccountStore.SaveCharacter(p) + } + } + sess.Write("\r\n> ") } |
