v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Editing User:Quietust/parsebody.php
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 124: | Line 124: | ||
if (isset($part['UPPERBODY'])) | if (isset($part['UPPERBODY'])) | ||
{ | { | ||
− | verbose(" | + | verbose("-"); |
return TRUE; | return TRUE; | ||
} | } | ||
$types = 0; | $types = 0; | ||
+ | $found = FALSE; | ||
$numcon = $numcat = $numtype = 0; | $numcon = $numcat = $numtype = 0; | ||
if (isset($part['CON'])) | if (isset($part['CON'])) | ||
Line 145: | Line 146: | ||
{ | { | ||
$types++; | $types++; | ||
− | |||
foreach ($body as $bp) | foreach ($body as $bp) | ||
{ | { | ||
Line 152: | Line 152: | ||
if ($part['CON_CAT'] == $bp['CATEGORY']) | if ($part['CON_CAT'] == $bp['CATEGORY']) | ||
{ | { | ||
− | |||
if ($numcat) | if ($numcat) | ||
verbose("...and the $part[name] bone's connected to the $bp[name] bone"); | verbose("...and the $part[name] bone's connected to the $bp[name] bone"); | ||
Line 161: | Line 160: | ||
} | } | ||
} | } | ||
− | if (!$ | + | if (!$numcat) |
warning("Body part $part[id] could not find [CATEGORY:$part[CON_CAT]] body part to connect to!"); | warning("Body part $part[id] could not find [CATEGORY:$part[CON_CAT]] body part to connect to!"); | ||
} | } | ||
Line 167: | Line 166: | ||
{ | { | ||
$types++; | $types++; | ||
− | |||
foreach ($body as $bp) | foreach ($body as $bp) | ||
{ | { | ||
if (isset($bp[$part['CONTYPE']])) | if (isset($bp[$part['CONTYPE']])) | ||
{ | { | ||
− | |||
if ($numtype) | if ($numtype) | ||
verbose("...and the $part[name] bone's connected to the $bp[name] bone"); | verbose("...and the $part[name] bone's connected to the $bp[name] bone"); | ||
Line 180: | Line 177: | ||
} | } | ||
} | } | ||
− | if (!$ | + | if (!$numtype) |
warning("Body part $part[id] could not find [$part[CONTYPE]] body part to connect to!"); | warning("Body part $part[id] could not find [$part[CONTYPE]] body part to connect to!"); | ||
} | } | ||
Line 253: | Line 250: | ||
if (!count($bodies)) | if (!count($bodies)) | ||
error("unable to locate any body part definitions - please run this from the game's root folder (or from a region folder)"); | error("unable to locate any body part definitions - please run this from the game's root folder (or from a region folder)"); | ||
+ | |||
foreach (glob("raw/objects/*.txt") as $filename) | foreach (glob("raw/objects/*.txt") as $filename) | ||
Line 262: | Line 260: | ||
if (($token) && ($token[0] == 'OBJECT') && ($token[1] == 'CREATURE')) | if (($token) && ($token[0] == 'OBJECT') && ($token[1] == 'CREATURE')) | ||
{ | { | ||
− | $creature = | + | $creature = 0; |
while (1) | while (1) | ||
{ | { | ||
Line 270: | Line 268: | ||
if ($token[0] == 'CREATURE') | if ($token[0] == 'CREATURE') | ||
$creature = $token[1]; | $creature = $token[1]; | ||
− | if | + | if ($token[0] == 'BODY') |
{ | { | ||
if (in_array($filter, array($creature, 'all'))) | if (in_array($filter, array($creature, 'all'))) |