Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function ValidateFigure($gender, $figure, $vip = false, $club = false, $ignoreselectable = true)
- {
- $settypes = explode('.', $figure);
- foreach ($settypes as $settype)
- {
- @list ($type, $id, $colorid) = explode('-', $settype);
- if (!isset($this->sets[$type]))
- {
- return false;
- }
- if (!isset($this->sets[$type][$id]))
- {
- return false;
- }
- $set = $this->sets[$type][$id];
- $paletteid = $this->setscolors[$type];
- if ($set['gender'] != $gender && $set['gender'] != 'U')
- {
- return false;
- }
- if ($set['selectable'] == '0' && !$ignoreselectable)
- {
- return false;
- }
- if ($set['colorable'] == '1' && isset($colorid))
- {
- if (!isset($this->colors[$paletteid]))
- {
- return false;
- }
- if (!isset($this->colors[$paletteid][$colorid]))
- {
- return false;
- }
- $color = $this->colors[$this->setscolors[$type]][$colorid];
- if ($color['selectable'] == '0' && !$ignoreselectable)
- {
- return false;
- }
- }
- if ($set['colorable'] == '0' && isset($colorid))
- {
- return false;
- }
- if ($vip || $club)
- {
- $maxclub = ($vip) ? 2 : 1;
- if ($set['club'] > $maxclub)
- {
- return false;
- }
- if ($color['club'] > $maxclub && $set['colorable'] == '1' && isset($colorid))
- {
- return false;
- }
- }
- else if ($set['club'] != '0')
- {
- return false;
- }
- }
- return true;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement