Bugs ...Report and help Fix

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1294 by Nerian
Bugs ...Report and help Fix was created by Nerian
Ok guys I thought it might be beneficial for us to have a topic where we can report bugs and fixes or get help with getting bugs fixed that we have found


I have found a bug in Gickers D20 that I'm having a bit of a problem correcting....

My players after setting up stats can type setstats reset and reset their stats at any point in time they like...I foresee this being abused by restatting before leveling up to get more skill points...before a fight to get better Dex ...etc, etc..

Can anybody take a look

the lines I'm thinking maybe causing the problems are as follows
if (is_abbrev(arg1, "reset")) {
    send_to_char(ch, "You reset your stats back to the default values.\r\n");
    GET_STAT_POINTS(ch) = 20;
    ch->real_abils.str = 10;
    ch->real_abils.dex = 10;
    ch->real_abils.con = 10;
    ch->real_abils.intel = 10;
    ch->real_abils.wis = 10;
    ch->real_abils.cha = 10;
    return 1;
  }


or
if (GET_STAT_POINTS(ch) == 0) {
    send_to_char(ch, "You need to type @Ysetstats reset@n if you want to change your stats after using all of your points.\r\n");
    return 1;


Now I don't mind if they are in the stat room and resetting stats because they made a mistake, I am completely ok with that, but after they leave that room, I don't want them to be able to reset their stats to avoid abuse.

I have tried to change the above code into this
if (is_abbrev(arg1, "reset") && GET_ROOM_VNUM(IN_ROOM(ch)) == 30003) {
    send_to_char(ch, "You reset your stats back to the default values.\r\n");
    GET_STAT_POINTS(ch) = 30;
    ch->real_abils.str = 10;
    ch->real_abils.dex = 10;
    ch->real_abils.con = 10;
    ch->real_abils.intel = 10;
    ch->real_abils.wis = 10;
    ch->real_abils.cha = 10;
    return 1;
  }

but to no avail my test PCs can still reset anywhere

any help would be very much appreciated

Please Log in or Create an account to join the conversation.

  • Vatiken
  • Vatiken's Avatar
  • Offline
  • Administrator
  • Administrator
  • tbaMUD Programmer
More
10 years 4 months ago #1295 by Vatiken
Replied by Vatiken on topic Re: Bugs ...Report and help Fix
Looks fine, issue is probably somewhere else. Did you do a full 'make clean' and recompile?

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 4 months ago #1296 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
If a full 'make clean' and recompile don't work, let me know, I can try helping you out, I keep a copy of the codebase in my account.

Another option is to make the whole 'stat' command a room-spec, and then assign it to the room(s) you want.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1345 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix
make clean and make compile cleanly, but it didn't change the fact that they can still reset their stats anywhere


it is in the spec_procs.c ill post the full spec proc when i get hone tobight

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #1346 by Liko
Replied by Liko on topic Re: Bugs ...Report and help Fix
Why not make it check the room for room flag that allows stat resetting in that room?

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 4 months ago #1347 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
Hey Nerian:

I looked at the code, there is duplicate functions.

If you just go to the copy of the function in act.other.c and delete or comment it out. Then go to interpreter.c and changed the 'setstat' entry in the command table to do_not_here instead of do_set_stat. Then go to spec_procs.c and get rid of the do_set_stats function call in the SPEC() for setstats. It should work fine, I tested it out.

Let me know if you need more detailed explanation how to fix it.

-Zusuk

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100
The following user(s) said Thank You: Nerian

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1353 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix
Hah that worked perfectly....now I won't be worried about abusers trying to restat when levelling up and such...

thanks much

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1362 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix
Ok guys I have another bug and after wracking my braid and trying a few different things I can't seem to figure it out


in Gickers you are supposed to see something along the lines of


A male Silvanesti Elf with a single, long braid is here.


instead it only shows

with a single, long braid is here.



I think I have found the code in char_descs.c shown below

Lost Lands is a fantasy mud and doesn't need the RACE_TYPE_DROID from star wars if it needs to be taken out...

if I am looking in the completely wrong area somebody please let me know

I'm hoping my understanding is correct

this top portion is supposed to set the gender, the second line is supposed to add nothing if it's a droid and a space if it's not, and the third line is supposed to actually put the race

then in the switch below the desc set is called and then the particular description?

somebody please let me know if my thinking is correct in my analysis of this code
sprintf(desc, "a %s%s%s", race_list[GET_REAL_RACE(ch)].family == RACE_TYPE_DROID ? "" : genders[(int) sex], 
                race_list[GET_REAL_RACE(ch)].family == RACE_TYPE_DROID ? "" : " ",
                pc_race_types[(int) race]);

  
  
  switch (pcd1) {

  case FEATURE_TYPE_EYES:
    sprintf(desc, "%s with %s eyes", desc, eye_descriptions[pca1]);
    break;
  case FEATURE_TYPE_NOSE:
    sprintf(desc, "%s with %s %s nose", desc, AN(nose_descriptions[pca1]), nose_descriptions[pca1]);
    break;
  case FEATURE_TYPE_EARS:
    sprintf(desc, "%s with %s ears", desc, ear_descriptions[pca1]);
    break;
  case FEATURE_TYPE_FACE:
    sprintf(desc, "%s with %s features", desc, face_descriptions[pca1]);
    break;
  case FEATURE_TYPE_SCAR:
    sprintf(desc, "%s with %s", desc, scar_descriptions[pca1]);
    break;
  case FEATURE_TYPE_HAIR:
    sprintf(desc, "%s with %s", desc, hair_descriptions[pca1]);
    break;
  case FEATURE_TYPE_BUILD:
    sprintf(desc, "%s with %s %s frame", desc, AN(build_descriptions[pca1]), build_descriptions[pca1]);
    break;
  case FEATURE_TYPE_COMPLEXION:
    sprintf(desc, "%s with %s %s %s", desc, AN(complexion_descriptions[pca1]), complexion_descriptions[GET_PC_ADJECTIVE_1(ch)], 
                                      race_list[GET_REAL_RACE(ch)].family == RACE_TYPE_DROID ? "finish" : "complexion");
    break;
  
  }

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 4 months ago #1363 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
Yeah try this, replace your top sprintf with this:
  sprintf(desc, "a %s %s", genders[(int) sex], pc_race_types[(int) race]);

And then right below where it has the case FEATURE_TYPE_COMPLEXION:
  case FEATURE_TYPE_COMPLEXION:
    sprintf(desc, "%s with %s %s complexion", desc,
        AN(complexion_descriptions[pca1]),
        complexion_descriptions[GET_PC_ADJECTIVE_1(ch)]);
    break;

Let me know if that helped or not.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1364 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix
I had actually done that very same thing, which didn't change anything still doesn't show the gender or race in front of the pca1 description

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 4 months ago #1368 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
Hey I'm going to be gone for 2 days, so I cant take a more in-depth look at this moment.

I'll have to take a look again, I think it was working fine on the copy I have.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 4 months ago #1371 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix
no worries...not in a rush

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 4 months ago #1380 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
Hey Nerian:

I tested the 'stock' way its set up, i.e. the way you listed the code the first time.

It seems to work completely fine:

Zusuf, a male ogre with blue eyes and a button nose, is standing here.


I'd suggest maybe making sure that all your constants are set for all your races, besides that I'm not sure why you'd have an issue and my version doesn't

-Zusuk

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #1702 by Spencer
Replied by Spencer on topic Bugs ...Report and help Fix
I am running D20mud (and love it)..I am new to coding nad need a little help. I have a crash bug in fight.c and after unning gdb I am getting this:

Program received signal SIGSEGV, Segmentation fault.
make_corpse (ch=0x1a745e0) at fight.c:897
897 IN_ROOM(corpse) = NOWHERE;


And the code here is:

IN_ROOM(corpse) = NOWHERE;
char *tmpdesc = NULL, *tmpstr = IS_NPC(ch) ? ch->short_descr : which_desc(ch);
snprintf(buf2, sizeof(buf2), "corpse %s", tmpstr);
corpse->name = strdup(buf2);

snprintf(buf2, sizeof(buf2), "The corpse of %s is lying here.", tmpstr);
corpse->description = strdup(buf2);

snprintf(buf2, sizeof(buf2), "the corpse of %s", tmpstr);
corpse->short_description = strdup(buf2);
free(tmpdesc);



any help? Thanks in advance. :)

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 2 months ago #1703 by Nerian
Replied by Nerian on topic Bugs ...Report and help Fix
I remember having that same bug and it being something to do with the mud and generating the corpse


unfortunately I don't remember the fix for it...zusuk maybe you can shed some light on it because i do remember consulting with you on this one ...since you were the one who found the bug in Lost Lands

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 2 months ago #1704 by Nerian
Replied by Nerian on topic Re: Bugs ...Report and help Fix

zusuk wrote: Hey Nerian:

I tested the 'stock' way its set up, i.e. the way you listed the code the first time.

It seems to work completely fine:

Zusuf, a male ogre with blue eyes and a button nose, is standing here.


I'd suggest maybe making sure that all your constants are set for all your races, besides that I'm not sure why you'd have an issue and my version doesn't

-Zusuk




and I know this has been a while back, but life got busy.... the problem was only with people who were not introduced so if I made test1 and test2 and they had never met each other it would not show properly.

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 2 months ago #1707 by zusuk
Replied by zusuk on topic Re: Bugs ...Report and help Fix
Hey Spencer, can you give us the GDB output?

I think I remember the problem being that Gicker changed the code to not make a new object, but rather load an object and assign it as a corpse.

Double check to make sure you have a 'corpse' object that matches the vnum he's using in the code if that's the case.

Nerian: How ya doing man?? We released LuminariMUD if you want a copy, help yourself :)

-Zusuk

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100
The following user(s) said Thank You: Spencer

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #1710 by Spencer
Replied by Spencer on topic Re: Bugs ...Report and help Fix
all fixed...thanks for the help! :)

Please Log in or Create an account to join the conversation.

  • Nerian
  • Nerian's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 2 months ago #1718 by Nerian
Replied by Nerian on topic Bugs ...Report and help Fix
I saw that and have already downloaded a copy and think it's awesome... going to start changing things in it since I think it is more in line with what I wanted

Please Log in or Create an account to join the conversation.

  • zusuk
  • zusuk's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • LuminariMUD Developer
More
10 years 2 months ago #1729 by zusuk
Replied by zusuk on topic Bugs ...Report and help Fix
That's great, let us know if you find any bugs and we'll post fixes here

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 0.178 seconds