frame allocs (25.2): physics, npc, vehicles and wildlife's bounded growth declared - id tables to their most, a walker slot, a guest's copies, a player's own vehicle, a table at a load

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:01:30 +03:00
parent 082fd26bf1
commit 34664e867f
7 changed files with 8 additions and 0 deletions

View file

@ -9,6 +9,7 @@ export function npc_spawn(npc_st: mut NpcState, kind: int) -> NpcPerson {
break
}
}
@alloc_ok("a walker for each of np_max at most; one who left is reused")
if p == null {
if len(npc_st.np_walkers) >= npc_st.np_max { return null }
p = new NpcPerson

View file

@ -14,6 +14,7 @@ export function npc_mirroring(npc_st: NpcState) -> bool { return npc_st.np_mirro
# the host's slot: somebody new in it (born), or nobody (gone)
export function npc_put(npc_st: mut NpcState, slot: int, id: int, kind: int, look: int, seed: float, name: string, hx: float, hz: float) -> NpcPerson {
if slot < 0 or slot >= npc_st.np_max or kind < 0 or kind >= NPCK_COUNT { return null }
@alloc_ok("a guest's copy of the host's slots, no more than np_max")
while len(npc_st.np_walkers) <= slot {
let q = new NpcPerson
q.slot = len(npc_st.np_walkers)