Hi there,
This time i have problems to use new wings 2.5 in this webshop script.. When i buy, it put a kriss on warehouse...
As i can see, it can be problem of hex conversion because the id of new wings is bigger than 255..
There is the code:
AndCode:function smartsearch($whbin,$itemX,$itemY) { global $config, $db; if (substr($whbin,0,2)=='0x') $whbin=substr($whbin,2); $items = str_repeat('0', 120); $itemsm = str_repeat('1', 120); $i = 0; while ($i<120) { $_item = substr($whbin,($config['item_lenght']*$i), 32); $check_ref = hexdec(substr($_item, 19,1))/16; if($check_ref == 0.5) $type = floor(hexdec(substr($_item,18,2))/16); else $type = round(hexdec(substr($_item,18,2))/16); $query = $db->Query('SELECT x, y FROM DmN_Shopp WHERE item_id = '.hexdec(substr($_item,0,2)).' AND item_cat = '.$type.'', MUONLINE); if(hexdec(substr($_item,0,2)) != 255 && $type != 16){ if(!$db->numrows($query)){ $not_found = true; } else{ $not_found = false; } } $res = $db->fetch($query); $y = 0; while($y<$res['y']) { $y++;$x=0; while($x<$res['x']) { $items = substr_replace($items, '1', ($i+$x)+(($y-1)*8), 1); $x++; } } $i++; } $y = 0; while($y<$itemY) { $y++;$x=0; while($x<$itemX) { $x++; $spacerq[$x+(8*($y-1))] = true; } } $walked = 0; $i = 0; while($i<120) { if (isset($spacerq[$i])) { $itemsm = substr_replace($itemsm, '0', $i-1, 1); $last = $i; $walked++; } if ($walked==count($spacerq)) $i=119; $i++; } $useforlength = substr($itemsm,0,$last); $findslotlikethis='^'.str_replace('++','+',str_replace('1','+[0-1]+', $useforlength)); $i=0;$nx=0;$ny=0; while ($i<120) { if ($nx==8) { $ny++; $nx=0; } if ((@ereg($findslotlikethis, substr($items, $i, strlen($useforlength)))) && ($itemX+$nx<9) && ($itemY+$ny<16)) return $i; $i++; $nx++; } if($not_found == true){ return 1338; } return 1337; }
Code:$value1 = sprintf("%02X", $itemz['item_id'],00);
Someone has successfuly added new wings?





