Skip to content

MegaMOO 0.7.2-beta

Pre-release
Pre-release

Choose a tag to compare

@MalifaxLax MalifaxLax released this 04 Aug 12:54
· 160 commits to main since this release

Bug-fix release. The database in this archive already contains the verb changes; an existing world picks up the engine fixes but not the verbs (see the end).

Fixed: verbs could not return a value to their caller

Verb code runs inside a generated wrapper function, so a verb writing result = X was binding a local that vanished when the function returned None. Every verb using the documented result idiom had been answering None to every caller.

do_wait was the visible casualty. It reports whether a character may act — roundtime, unconscious, sleeping, paralyzed, webbed, immobilized, entangled, imprisoned, bound — and sets result = True in all eleven branches. So if call_verb(pobj, "do_wait"): never fired, while the verb still printed [Wait: N seconds] on its way out, which is exactly why it looked as though it worked. Five shipped verbs guarded on it (lock, unlock, latch, unlatch, buy) and all five were no-ops.

The wrapper now honours both return X and result = X. An explicit return still wins.

IC commands now gate on do_wait

Thirteen commands — get drop put give wear remove open close climb jump tap go inventory — each tested pobj.rt alone and missed the eight immobilising conditions. They now call do_wait.

Movement is included: typing a direction dispatches the compass verb, which had no roundtime check at all, so a character could walk away mid-roundtime. That gate is on the #17 (ICRoom) copy only — the same verb is defined separately on #15 and #16, and #16 is the out-of-character room, where roundtime from a fight should never strand anyone.

Verb code reads as attribute access

The verb library used getattr(obj, "prop", default) throughout — 627 calls across 112 of 202 files. The defence was never needed: a missing property returns a falsy sentinel rather than raising. 523 calls are now plain attribute access.

_NullAttr gains ordering, treating a missing property as 0, so pobj.rt > 0 is legal for a property that need not exist anywhere. Comparison against a non-number still raises.

Also

  • moo/moo_compat.pytell(), pass_() and the sixteen MOO error values as first-class comparable values, injected into every verb namespace
  • help no longer lists engine machinery or every abbreviation of every command, and no longer advertises staff commands to players who cannot run them
  • Documentation corrected: verb code runs with full Python privileges, and the gm3 gate on @program is the security boundary — there is no sandbox

Upgrading an existing world

Engine fixes arrive with the files. The verb changes live in the database and do not. Either start from the mm.db here, or copy the verbs you want from moo verbs/ — the auto-reloader will pick them up.