- Posts: 937
- Thank you received: 17
Undig
- JTP
- Topic Author
- Offline
- Platinum Member
-
Less
More
6 years 7 months ago #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.
Tired of edition two rooms to remove an exit.
Please Log in or Create an account to join the conversation.
- WhiskyTest
-
- Offline
- Platinum Member
-
Less
More
- Posts: 345
- Thank you received: 73
6 years 6 months ago #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
It can be separated into its own command if you prefer a unique command for it
in oasis_copy.c
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.125 seconds