Closed joligario closed 1 year ago
Is Range
a key or reserved word?
https://metacpan.org/pod/Number::Range
Couldn't reproduce this locally on a Windows server built with perl 5.24.4 or a Linux (debian 12) server built with 5.36.0. Is it fully reproducible on the server with a steadfast servant out or intermittent?
Intermittent, but I have a re-written lua version that should be getting pushed today/tomorrow.
Managed to reproduce this
1) edit the script and speed it up to something like $Frequency = 5;
2) #cast 6884
to summon it
3) #kill
your character (was bound in same zone)
4) observe quest error message (types in error message may differ depending on any debug msg done with them in script)
5) (optional)#cast 6883
to remove the steadfast servant
$Owner = GetClientByID($OwnerID)
returns undef$Owner
is being passed to the GetRandomClient
overload as a 6th argument but is undef/nullptr Client*By default perlbind will throw errors for a nullptr as an invalid argument
I think this could be considered a source bug around the GetRandomClient
overload. The 6th argument should probably accept an optional via perlbind::nullable<Client*>
that it can pass to the real EntityList
function whether it's null or not.
This could be worked around in the script by explicitly calling the overload if $Owner is undef:
if ($Owner)
{
$c = $entity_list->GetRandomClient($x, $y, $z, $Range, $Owner);
}
else
{
$c = $entity_list->GetRandomClient($x, $y, $z, $Range);
}
The arg types in the error message are a perlbind issue. I think the bug would have been far easier to immediately understand if the message had said (EntityList*, double, double, double, SCALAR, <undefined>)
.
$Range
is mutating to SV_PVNV (float as string) maybe from comparison checks in the script? This makes it default to generic output SCALAR
since that type is unhandled.$Owner
is getting mutated to SV_IV
(int) instead of SVt_NULL
that GetClientByID
returned. I'm not sure if this is because logic comparisons in the script are mutating the types or something else is happening.This is something to keep in mind if any more ambiguous perl script errors like this occur on the server (though rewriting in lua is the better option).
https://github.com/ProjectEQ/projecteqquests/blob/546faa94298c2f85c97c14cbcc6669b38d10e984/global/a_steadfast_servant.pl#L48
Server is getting
(EntityList, double, double, double, SCALAR, int)
.