admin fixes

master
Denis Ranneft 1 month ago
parent b5544c04f4
commit cae397a7d8

@ -1177,8 +1177,13 @@
<button class="btn" onclick="withAction(() => heroAction('set-gold',{gold:Number(document.getElementById('hero-gold').value)}))">Set Gold</button>
<button class="btn" onclick="withAction(() => heroAction('set-level',{level:Number(document.getElementById('hero-level').value)}))">Set Level</button>
<button class="btn" onclick="withAction(() => heroAction('revive',{}))">Revive</button>
<button class="btn" onclick="withAction(() => heroAction('start-rest',{}, true))">Start Rest</button>
<button class="btn" onclick="withAction(() => heroAction('start-rest',{}, true))" title="Town rest (same duration as normal town rest)">Start rest (town)</button>
<button class="btn" onclick="withAction(() => heroAction('start-roadside-rest',{}, true))" title="Roadside rest at current road position (not in excursion)">Start rest (roadside)</button>
<button class="btn" onclick="withAction(() => heroAction('stop-rest',{}, true))" title="Exit roadside or adventure-inline rest back to walking">Stop rest</button>
<button class="btn" onclick="withAction(() => heroAction('start-adventure',{}, true))" title="Force mini-adventure (excursion) while walking on road">Start adventure</button>
<button class="btn" onclick="withAction(() => heroAction('stop-adventure',{}, true))" title="End active excursion session">Stop adventure</button>
<button class="btn" onclick="withAction(() => heroAction('leave-town',{}))">Leave Town</button>
<p class="muted" style="margin-top:6px">Roadside / adventure controls require the hero alive, not in combat; adventure start needs <kbd>StateWalking</kbd> on a road.</p>
<div class="row" style="margin-top:12px;align-items:end">
<div><label class="muted">Teleport</label><button type="button" class="btn" onclick="withAction(loadTeleportTowns)">Load towns</button></div>
<div><select id="hero-teleport-town">${teleportOpts}</select></div>

@ -140,7 +140,7 @@ func (h *AdminHandler) writeAdminHeroDetail(w http.ResponseWriter, hero *model.H
out.Hero = *hm.Hero
out.Hero.RefreshDerivedCombatStats(now)
out.TownPause = hm.Hero.TownPause
out.AdminLiveMovement = buildAdminLiveMovementSnap(hm, now)
out.AdminLiveMovement = buildAdminLiveMovementSnap(hm)
}
writeJSON(w, http.StatusOK, out)
}
@ -2124,7 +2124,6 @@ func resetHeroToLevel1(hero *model.Hero) {
hero.State = model.StateWalking
hero.Buffs = nil
hero.Debuffs = nil
hero.BuffCharges = nil
hero.BuffFreeChargesRemaining = model.FreeBuffActivationsPerPeriodRuntime()
hero.BuffQuotaPeriodEnd = nil
now := time.Now()
hero.ResetBuffCharges(nil, now)
}

Loading…
Cancel
Save