Welcome to the Builder Academy

Question Bugs ...Report and help Fix

More
15 Jan 2013 04:45 #1294 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
Code:
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
Code:
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
Code:
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.

More
15 Jan 2013 05:20 #1295 by Vatiken
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.

More
15 Jan 2013 06:07 #1296 by zusuk
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.

More
15 Jan 2013 15:45 #1345 by Nerian
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
15 Jan 2013 17:10 #1346 by Liko
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.

More
15 Jan 2013 17:24 #1347 by zusuk
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.

Time to create page: 0.229 seconds