Character Browser Permission 'bag's hiding charm slot?
Reply
Permission 'bag's hiding charm slot?
Whenever you set...

'bags' => 1,


it also hides your charm slot.. I tried to dig through and find out why but I could not find out why.. :(

Any ideas?
Fri Feb 07, 2014 4:40 am
That's pretty wierd... No idea off the top of my head. Ill have to look through it.
Fri Feb 07, 2014 7:57 am
Project Lead
Fri Feb 07, 2014 8:01 am
Project Lead
No but it looks like you have bags turned on.. when you turn bags off it hides the Charm slot its odd
Fri Feb 07, 2014 7:34 pm
I found these in character.php.

php
More +
foreach ($allitems as $value) {

  if ($value->type() == INVENTORY && $mypermission['bags']) continue;

  if ($value->type() == EQUIPMENT || $value->type() == INVENTORY)

    $template->assign_block_vars("invitem", array(

      'SLOT' => $value->slot(),    

      'ICON' => $value->icon(),

      'ISBAG' => (($value->slotcount() > 0) ? "true":"false"))

    );

}


php
More +
foreach ($allitems as $value) {

  if ($value->type() == INVENTORY && $mypermission['bags']) continue;

  if ($value->type() == BANK && $mypermission['bank']) continue;

  if ($value->slotcount() > 0)  {

 

    $template->assign_block_vars("bags", array(

      'SLOT' => $value->slot(),    

      'ROWS' => floor($value->slotcount()/2))

    );

   

    for ($i = 1;$i <= $value->slotcount(); $i++)

      $template->assign_block_vars("bags.bagslots", array(

        'BS_SLOT' => $i)

      );

     

    foreach ($allitems as $subvalue)

                if ($subvalue->type() == $value->slot())

                  $template->assign_block_vars("bags.bagitems", array(

                    'BI_SLOT' => $subvalue->slot(),

                    'BI_RELATIVE_SLOT' => $subvalue->vslot(),

                    'BI_ICON' => $subvalue->icon())

                  );

  }

}


php
More +
foreach ($allitems as $value) {

  if ($value->type() == INVENTORY && $mypermission['bags']) continue;

  if ($value->type() == BANK && $mypermission['bank']) continue;

    $template->assign_block_vars("item", array(

      'SLOT' => $value->slot(),    

      'NAME' => $value->name(),

      'ID' => $value->id(),

      'HTML' => $value->html())

    );

    for ( $i = 0 ; $i < $value->augcount() ; $i++ ) {

      $template->assign_block_vars("item.augment", array(          

        'AUG_NAME' => $value->augname($i),

        'AUG_ID' => $value->augid($i),

        'AUG_HTML' => $value->aughtml($i))

      );

    }

}
Fri Feb 07, 2014 7:56 pm
You thinking the charm is getting set as type INVENTORY? I may have a chance to sit down with it tomorrow and see whats going on after I get the /target problem fixed in the PEQ MQ build.
Fri Feb 07, 2014 10:39 pm
Project Lead
php
More +
           switch ($this->myslot){
                //case ($this->myslot >= 0 && $this->myslot <= 21):                          //removed line 2/5/2014
                case ($this->myslot >= 0 && $this->myslot <= 21 || $this->myslot == 9999):   //added line 2/5/2014
                     $this->mytype = 1;
                     $this->myvslot = $this->myslot;
                     break;
                case ($this->myslot >= 22 && $this->myslot <= 29):
                     $this->mytype = 2;
                     $this->myvslot = $this->myslot;
                     break;


Okay, this is what's happening. The slot for the charm is 0, so switch ($this->myslot) is of course seeing what this value should be (a zero of course).

case ($this->myslot >= 0 && $this->myslot <= 21 || $this->myslot == 9999): evaluates to a true

and

case ($this->myslot >= 22 && $this->myslot <= 29): evaluates to false

So we get this:

php
More +
           switch ($this->myslot){
                //case ($this->myslot >= 0 && $this->myslot <= 21):                          //removed line 2/5/2014
                case true:   //added line 2/5/2014
                     $this->mytype = 1;
                     $this->myvslot = $this->myslot;
                     break;
                case false:
                     $this->mytype = 2;
                     $this->myvslot = $this->myslot;
                     break;


Since the switch is comparing a 0, it compares the first case as (true == 0) and we get an evaluation of false. Then it checks the next case (false == 0) which evaluates to true and the charm gets set as a 2 which is the bag type.
Sun Feb 09, 2014 3:03 pm
Project Lead
any suggestions? I'm thinking it might make the most sense to just change it to big if statement.
Sun Feb 09, 2014 3:09 pm
Project Lead
oh, duh, change line 80 from:

php
More +
           switch ($this->myslot){


to

php
More +
           //switch ($this->myslot){ //removed line 2/9/2014
           switch (true){


haven't tested a bunch but that should work
Sun Feb 09, 2014 3:23 pm
Project Lead
That fixed the issue.

Mon Feb 10, 2014 4:15 pm
posting the fix as 2.25 along with new item icons all the way through RoF
Wed Feb 12, 2014 7:15 pm
Project Lead
Character Browser Permission 'bag's hiding charm slot?
Reply