Reply to Re: Dink Engine bug - global variables get confused
If you don't have an account, just leave the password field blank.
: : I've come across a bug... or rather WC did, in PQ in which the powerful magic spells are instantly recharged.
: : It seems that the global varilables &magic_level and &magic_cost get confused with the variable &magic (as all three have the first 5 letters in common) so that if your &magic is say 18 then &magic_level becomes 18_level and &magic_cost becomes 18_cost.
: : When this happens and you arm a new weapon (not magic, arming a new magic resets things properly, though I don't know why) - you get instant (in human time) magic... be it Deus Strike or whatever.
: : I can't think of a way around this as I can't guarantee what magic is in which slot (or I'd do a quick change magic to fireball, arm it, change to &cur_magic and re-arm it) - compare_magic doesn't work, of course.
: : Any takers on this one?
: I've incountered similar, though I not quite sure I understand the problem your're describing. I know that &magic_level will become 18_level (where 18 is &magic) if used in a say command and I think also be treated as 18 in an if statment, but it work correctly in an an assignment statment (which may be the only place it works right), does that explain anything?
: I don't quite understand the bug, I didn't notice anything odd when arming weapons.
Yeah, I didn't seem to have any problems with it in PQ either... odd.
Anyway, there is an easy work-around, as Paul hinted at. Just do something like this:
int &temp = &magic_level;
if (&temp > &sillynumber)
{
&temp -= 5;
}
&magic_level = &temp;
Or whatever else you need to do. I had to do something similar with FIAT v0.99 in order to get the mana potions to work.
: : It seems that the global varilables &magic_level and &magic_cost get confused with the variable &magic (as all three have the first 5 letters in common) so that if your &magic is say 18 then &magic_level becomes 18_level and &magic_cost becomes 18_cost.
: : When this happens and you arm a new weapon (not magic, arming a new magic resets things properly, though I don't know why) - you get instant (in human time) magic... be it Deus Strike or whatever.
: : I can't think of a way around this as I can't guarantee what magic is in which slot (or I'd do a quick change magic to fireball, arm it, change to &cur_magic and re-arm it) - compare_magic doesn't work, of course.
: : Any takers on this one?
: I've incountered similar, though I not quite sure I understand the problem your're describing. I know that &magic_level will become 18_level (where 18 is &magic) if used in a say command and I think also be treated as 18 in an if statment, but it work correctly in an an assignment statment (which may be the only place it works right), does that explain anything?
: I don't quite understand the bug, I didn't notice anything odd when arming weapons.
Yeah, I didn't seem to have any problems with it in PQ either... odd.
Anyway, there is an easy work-around, as Paul hinted at. Just do something like this:
int &temp = &magic_level;
if (&temp > &sillynumber)
{
&temp -= 5;
}
&magic_level = &temp;
Or whatever else you need to do. I had to do something similar with FIAT v0.99 in order to get the mana potions to work.