Allow specifying object classes in the object name given to des.object()

and actually do so in the lua files.

Before this, it was not possible to specify (for example) "scroll of
teleportation" in des.object() because there is actually no object
defined in objects.h named "scroll of teleportation", so
find_objtype() failed to find it.  Instead, one had to request
"teleportation", but that is ambiguous, and find_objtype() would find
the first defined item with that name instead (ring of teleportation).

In cases of ambiguity, I referred to the des files from 3.6.6 (before
the lua conversion).
This commit is contained in:
vultur-cadens
2022-04-23 16:59:15 -07:00
committed by PatR
parent 9054f97b41
commit 3571934c59
12 changed files with 51 additions and 25 deletions

View File

@@ -54,8 +54,8 @@ des.trap("pit",05,08)
des.trap("pit",06,08)
-- A little help
des.object("earth",01,09)
des.object("earth",02,09)
des.object("scroll of earth",01,09)
des.object("scroll of earth",02,09)
-- Random objects
des.object({ class = "%" });