Phantasmal MUD Lib for DGD

Phantasmal Site > Phantasmal API > API Listing > mobile_from_dtd_unq

API Function: mobile_from_dtd_unq

Summary:
static function, used for partial parsing of mobiles from DTD-parsed UNQ

Defined In LPC Object:
/usr/common/lib/mobile.c

Prototype:
mixed mobile_from_dtd_unq(mixed *unq)

Can Be Called By:
System, Common, Game

Description:

This implements parsing of common fields for mobiles from a DTD UNQ description. A subtype can parse out only the specific fields it recognizes, then pass the resulting UNQ to this function for further parsing. See the animal_mobile for a simple example.

If there is a 'data' field in the UNQ data, its value will be passed back as the return value. If there is no such value, nil will be returned.

You should access-protect your version of this and all other inherited functions, including upgraded() and destructed().

Return Value:

The data field from the UNQ object, or nil.

Errors:
Unrecognized fields or malformed UNQ will cause errors.

See Also:
Mobile:to_unq_text