Closed paladine closed 4 years ago
Couple issues here that prevented spells from being read.
skpwrd
was returning Registers.SetPointer(stringPointerBase + i);
, where i
was defined in the for
loop as var i = stringPointerBase.Offset
. So basically it was returning offset + offset + delta. 👎
I fixed skpwrd
to return the correct pointer.
The next issue was lastwd
was establishing a new buffer and returning a pointer to another string, where the documentation states it returns a pointer to the string passed in:
I updated lastwd
to return .LastIndexOf(' ')
and add that to the offset (handling -1
not found by adding 1, pointing to the start of the string).
I'm writing Unit Tests for both of these methods and I'll get the PR in.
Module Information WCCMMUD
Describe the bug I created a Paladin, bought two spell scrolls. I read the first which seemed to work, though there was some sort of
prfmsg
shortening. The second scroll I read crashed the systemTo Reproduce See above
Expected behavior I learn the spell.