Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ I face an important bug.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Oblisgr
(123 posts) Bio
|
Date
| Sun 19 Jul 2020 08:07 PM (UTC) |
Message
| Hi i just ask if someone have noticed a bug like this.
When i save my game the attributes and the ac of my player are rising. Each time i save they all go up.
I replaced my save.c with a fresh one and nothing changed so for sure it is not from there.
Anyone has face a bug like thing from his coding experience?
I m trying to find what causes the problem and fix it but i can figure ouy what other files are interract with this kind of stuff.
If anyone knows...
I will be grateful | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sun 19 Jul 2020 09:15 PM (UTC) |
Message
| Do you mean, when you type "save" your HP etc. immediately go up in game? Without reloading? Or do you mean, they are higher next time when you load the game, compared to when you saved it?
What you could do is type "save" and then edit your player file and see if the correct numbers were saved, eg.
#PLAYER
Version 5
Name Admin~
Sex 1
Class 5
Race 1
Age 0 23 9 605
Languages -1 1
Level 65
Played 31580733
Room 21004
HpManaMove 24 24 145 145 110 110 <----- HERE
If the numbers in the save file are wrong, you have a problem in your saving.
However if they are correct, but higher when next loaded, you have a problem in your loading code. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Oblisgr
(123 posts) Bio
|
Date
| Reply #2 on Mon 20 Jul 2020 06:22 AM (UTC) |
Message
| The numbers in pfile are changing too.
Everytime i do save the numbers there change too.
I replaced my save.c file with a clean one and did that just to check if i have the bug, and ideed i had so if i m right and save.c is the file that handles the saving, then it has no problem.
I dont thing it is a loading problem since the mud reads the wrong values that the pfile has.
The thing is that every time it stacks the new values to the old one. For example if Str is 10, after save it will be 11 (+1), then i save again and it gets 11 from pfile and adds +1 so 12 and goes on.
I also tried to grep for the AttrMod just to check if something else might be occured somewhere else but i havent touched anything there. | Top |
|
Posted by
| Oblisgr
(123 posts) Bio
|
Date
| Reply #3 on Mon 20 Jul 2020 04:11 PM (UTC) Amended on Mon 20 Jul 2020 04:14 PM (UTC) by Oblisgr
|
Message
| I think i found why the ac is messed up.
I have 3 armor skills in my mud, light, medium and heavy.
I wanted to make them give extra ac by skill level so i replaced in handler.c under apply_ac function the following code with the next one but it causes problems.
Do you see how i cant be fixed maybe?
case WEAR_BODY:
return obj->value[0];
case WEAR_BODY:
if( obj->value[5] == 1 )
{
if(LEARNED(ch, gsn_lightarmor) > 0)
{
armortype = ((obj->value[0] * 10) + LEARNED(ch, gsn_lightarmor))/10;
}
}
if( obj->value[5] == 2 )
{
if(LEARNED(ch, gsn_mediumarmor) > 0)
{
armortype = ((obj->value[0] * 10) + LEARNED(ch, gsn_mediumarmor))/10;
}
}
if( obj->value[5] == 3 )
{
if(LEARNED(ch, gsn_heavyarmor) > 0)
{
armortype = ((obj->value[0] * 10) + LEARNED(ch, gsn_heavyarmor))/10;
}
}
return armortype;
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
11,629 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top