- Posts: 43
- Thank you received: 9
Bugs ...Report and help Fix
- Nerian
-
Topic Author
- Offline
- Senior Member
-
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
-
- Offline
- Administrator
-
- tbaMUD Programmer
- Posts: 227
- Thank you received: 52
tbaMUD developer/programmer
Please Log in or Create an account to join the conversation.
- zusuk
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
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.
- Liko
-
- Offline
- Platinum Member
-
- Posts: 452
- Thank you received: 78
Randian(0.0.0)
Owner/Developer
Please Log in or Create an account to join the conversation.
- zusuk
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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
Please Log in or Create an account to join the conversation.
- Nerian
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
thanks much
Please Log in or Create an account to join the conversation.
- Nerian
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
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
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
Please Log in or Create an account to join the conversation.
- zusuk
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
Please Log in or Create an account to join the conversation.
- zusuk
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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.
- Spencer
- Offline
- New Member
-
- Posts: 8
- Thank you received: 1
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
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
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
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
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
-
- Offline
- Elite Member
-
- LuminariMUD Developer
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
Please Log in or Create an account to join the conversation.
- Spencer
- Offline
- New Member
-
- Posts: 8
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- Nerian
-
Topic Author
- Offline
- Senior Member
-
- Posts: 43
- Thank you received: 9
Please Log in or Create an account to join the conversation.
- zusuk
-
- Offline
- Elite Member
-
- LuminariMUD Developer
Website
www.luminariMUD.com
Main Game Port
luminariMUD.com:4100
Please Log in or Create an account to join the conversation.