Manual:DIL Manual/objectflags

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:12, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

objectflags

Field (integer, read/write; units: objects).

obj.objectflags : integer

The object's flags, set with romflags in the object's zone definition (flags there sets the unit flags). The flags, in vme.h: OBJ_NO_UNEQUIP (can't be removed once worn), OBJ_TWO_HANDS (needs both hands), OBJ_NOCOVER (worn, it doesn't cover the body part) and OBJ_NO_DUAL (can't be the second weapon when wielding two). Test and change them with isset(), set() and unset().

These are not the unit flags (UNIT_FL_*, the flags field) every unit has.

Notes

  • Objects only. On a character, a room or null it fails.
  • Stored as 8 bits: only the lowest eight flag bits can be set.

Example

dilbegin integer can_dual(wpn : unitptr);
code
{
   if (wpn.type != UNIT_ST_OBJ)
      return (FALSE);
   if (isset(wpn.objectflags, OBJ_NO_DUAL) or isset(wpn.objectflags, OBJ_TWO_HANDS))
      return (FALSE);
   return (TRUE);
}
dilend

Tells whether a weapon may be used in a dual-wield, as the checks in commands.zon and skills.zon.

See also