What am i doing wrong?
I'm getting an visual issue in inventory, when i right click an item and then after using the shift click function to fill it up with other items like for lasers with 2 lf-4 + 13 lf3.
Or using the shift+click function.
Edit: i know there are no backlink to epvp, but this sh*t troubles me...
PHP Code:
private function CompleteTrans($m, $ret) {
if ($ret == 2):
$jsn = json_decode('{"isError":0,"data":{"ret":[]}}');
foreach ($m as $k => $r):
array_push($jsn->data->ret, $r);
endforeach;
elseif ($ret == 1):
$jsn = json_decode('{"isError":0,"data":{"ret":1}}');
else:
$jsn = json_decode('{"isError":0,"data":{"ret":0}}');
endif;
$jsn->data->money = $this->money;
return base64_encode(json_encode($jsn));
}
private function shipspace($what, $target, $equipment) {
$eqs = $equipment;
$sm = $eqs->data->ret->hangars[0]->general->{$target}->SM;
$lids = $eqs->data->map->lootIds;
$Lp = array_keys($lids, $sm);
$lo = $Lp[0];
$where = $eqs->data->ret->itemInfo;
foreach ($where as $ke => $va):
if ($va->L == $lo) {
$totalSlots = $va->levels[0]->slotsets->{$what}->Q;
}
endforeach;
return $totalSlots;
}
private function NotEmptyShip($result, $what, $target, $equipment){
$s = self::shipspace($what, $target, $equipment);
if (strpos($result[0]->{$what}, '|') !== false) {
$pie = explode("|", $result[0]->{$what});
$c = count($pie);
$e = $s-$c;
$k = count($this->params->from->items);
if($k>=$e):
for($i=0; $i<$e; $i++){
array_push($pie, $this->params->from->items[$i]);
}
self::addToDB($pie, $target, $what);
return self::CompleteTrans($pie, 2);
elseif($k<$e):
for($i=0; $i<$k; $i++){
array_push($pie, $this->params->from->items[$i]);
}
self::addToDB($pie, $target, $what);
return self::CompleteTrans($pie, 1);
endif;
}else{
$pie = explode("|", $result[0]->{$what});
$k = count($this->params->from->items);
$r = $s-1;
if($k>=$r):
for($i=0; $i<$r; $i++){
array_push($pie, $this->params->from->items[$i]);
}
self::addToDB($pie, $target, $what);
return self::CompleteTrans($pie, 2);
elseif($k<$r):
for($i=0; $i<$k; $i++){
array_push($pie, $this->params->from->items[$i]);
}
self::addToDB($pie, $target, $what);
return self::CompleteTrans($pie, 1);
endif;
}
}
My current result json encoded:
PHP Code:
{"isError":0,"data":{"ret":["300","301","302","303","304","305","306","307","308","309","310","311","312","313","314"],"money":{"uridium":"496,151,000","credits":"481,506,190"}}}
Hopping someone know what i'm doing wrong.
Currently uploading tons of fixes for inventory...
Edit: i always wipe the player/user item and config tables after a major upload... sorry..
EDIT:MY shift bug is fixed.. i figured it out by myself
Best Regards Bau