Sim Posted July 17, 2020 Share Posted July 17, 2020 I'm going to use this topic for various small encounters I have. DATA: array(4) { [0]=> array(11) { ["invID"]=> string(2) "30" ["itemID"]=> string(1) "1" ["name"]=> string(14) "Military knife" ["fileType"]=> string(4) ".png" ["height"]=> string(3) "100" ["width"]=> string(3) "100" ["price"]=> string(2) "32" ["value"]=> string(2) "17" ["types"]=> string(6) ":0:24:" ["slot"]=> string(18) "LEFT Handed Weapon" ["slotID"]=> string(2) "10" } [1]=> array(2) { ["slot"]=> string(8) "Headware" ["slotID"]=> string(2) "11" } [2]=> array(11) { ["invID"]=> string(2) "14" ["itemID"]=> string(1) "3" ["name"]=> string(11) "Claw Hammer" ["fileType"]=> string(4) ".png" ["height"]=> string(3) "100" ["width"]=> string(3) "100" ["price"]=> string(2) "21" ["value"]=> string(1) "8" ["types"]=> string(6) ":0:24:" ["slot"]=> string(7) "Special" ["slotID"]=> string(2) "32" } [3]=> array(2) { ["slot"]=> string(19) "Right handed weapon" ["slotID"]=> string(2) "35" } } $equipedItems = $this->getPlayerSlotInfo($userID); debug(var_dump($equipedItems)); foreach($equipedItems as $item) { //debug($item); if(!empty($item["types"])) { $iTypes = explode(":", $item['types']); $types = ""; debug($item); for($z=1;$z<count($iTypes)-1;$z++){ $type = ""; if($iTypes[$z] != 0 && $iTypes != ""){ $type = $this->getItemType($iTypes[$z]); //debug($type); if($type['parentID'] == "Weapon") { debug("Weapon"); unset($item); break 1; } } } } } The problem is it shows WEAPON 4X WHEN IT SHOULD ONLY BE DONE Complete debug DATA: Nevermind. I just hire realized I was curious do in the method twice so double the days and was deciding this for hours. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted July 17, 2020 Share Posted July 17, 2020 To clarify, are these issues you're experiencing with official GL stuff, or are you effectively tracking issues from your own modifications to your copy of GL? Quote Link to comment Share on other sites More sharing options...
Sim Posted July 20, 2020 Author Share Posted July 20, 2020 //THIS A SNIPPLET $mainType = new $data['parentID']($data); debug("test"); debug(var_dump($mainType)); //EXTRA DATA $extraData = $mainType->getAdminHTML(); debug("test"); debug($extraData); if($extraData != "") { debug("test"); return $this->createNewItemTypeWithExtraData($mainType, $data, "new"); } The problem occurs when I call the method. Not while initiating the class. File: /home/simmakew/public_html/GL/modules/installed/itemTypes/Types/ItemTypes.interface.php Line: 3 Error: Cannot declare interface Item_Type, because the name is already in use Type: E_RECOVERABLE_ERROR Anyone got any ideas? Quote Link to comment Share on other sites More sharing options...
Dave Posted July 20, 2020 Share Posted July 20, 2020 SNIPPLET is a hilarious term, I love it. The error suggests you have duplicated interfaces? Do you have another interface declared somewhere with the same name? Quote Link to comment Share on other sites More sharing options...
Sim Posted July 20, 2020 Author Share Posted July 20, 2020 No. That's why it's surprised me. In think I might have called it twice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.