Leetsauce
08-19-2014, 03:15 PM
Context: I use keys on my server instead of qglobal "flags", and I generally make it an item or augment that the character can wear.
So I ran into an issue today where check_hasitem was crashing zones (due to checking corpses) and happened to stumble upon an issue with the check_hasitem.pl plugin that did NOT check the powersource slot. Simple fix was to take the powersource off, put it in your inventory, and the check worked successfully. So, it led me here:
#Check main inventory and cursor
for($slot1=0; $slot1<=9999; $slot1++) {
$itemid1=$client->GetItemIDAt($slot1);
for($i=0; $i<5; $i++) {
$augid1=$client->GetAugmentIDAt($slot1, $i);
if($augid1==$itmchk) {
return 1;
}
}
Changing the second variable:$slot1<=30(inventory slots minus the power source slot) to $slot1<=9999(9999 is the slot #peekinv tells you the power source is found) fixed the issue, and forced the routine to check the power source slot. I only had to alter it in this section alone for my intended purpose, but I figured I would share just in case someone runs into the same issue. I suck at perl, so this one took me a minute or two to solve and wish to pass on what I've learned.
Thanks!
So I ran into an issue today where check_hasitem was crashing zones (due to checking corpses) and happened to stumble upon an issue with the check_hasitem.pl plugin that did NOT check the powersource slot. Simple fix was to take the powersource off, put it in your inventory, and the check worked successfully. So, it led me here:
#Check main inventory and cursor
for($slot1=0; $slot1<=9999; $slot1++) {
$itemid1=$client->GetItemIDAt($slot1);
for($i=0; $i<5; $i++) {
$augid1=$client->GetAugmentIDAt($slot1, $i);
if($augid1==$itmchk) {
return 1;
}
}
Changing the second variable:$slot1<=30(inventory slots minus the power source slot) to $slot1<=9999(9999 is the slot #peekinv tells you the power source is found) fixed the issue, and forced the routine to check the power source slot. I only had to alter it in this section alone for my intended purpose, but I figured I would share just in case someone runs into the same issue. I suck at perl, so this one took me a minute or two to solve and wish to pass on what I've learned.
Thanks!