Welcome to the Builder Academy

Question Undig

More
20 Jun 2016 22:54 #6029 by JTP
Undig was created by JTP
Anyone who has a undig wiz command they wanna share ?

Tired of edition two rooms to remove an exit.

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

More
02 Jul 2016 22:53 #6069 by WhiskyTest
Replied by WhiskyTest on topic Undig
Add this to do_dig and when you type 'dig <dir> -1' it will remove the corresponding exit from the other side.
It can be separated into its own command if you prefer a unique command for it

in oasis_copy.c
Code:
ACMD(do_dig) { . . . /* Target room == -1 removes the exit. */ if (rvnum == NOTHING) { if (W_EXIT(IN_ROOM(ch), dir)) { + /* remove the exit on the other side */ + if (EXIT(ch, dir)->to_room != NOWHERE) + if ((world[EXIT(ch, dir)->to_room].dir_option[rev_dir[dir]]) != NULL) + { + /* free the old pointers on other side, if any */ + if (W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir])->general_description) + free(W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir])->general_description); + if (W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir])->keyword) + free(W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir])->keyword); + + free(W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir])); + W_EXIT(EXIT(ch, dir)->to_room, rev_dir[dir]) = NULL; + } /* free the old pointers, if any */
The following user(s) said Thank You: JTP

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

Time to create page: 0.207 seconds