REDIT( redit_create )
{
AREA_DATA *pArea;
ROOM_INDEX_DATA *pRoom;
char arg [ MAX_INPUT_LENGTH ];
int value, iHash;
argument = one_argument( argument, arg );
value = atoi(arg);
if (arg[0] == '\0' || value == 0)
{
send_to_char("{YSyntax: create [vnum]\n\r", ch);
return FALSE;
}
pArea = get_vnum_area(value);
if (pArea == NULL)
{
send_to_char("{YREdit: That vnum is not assigned an area.\n\r", ch);
{
send_to_char("{YREdit: That vnum is not assigned an area.\n\r", ch);
return FALSE;
}
if (!IS_BUILDER(ch, pArea))
{
send_to_char("{YREdit: Vnum in an area you cannot build in.\n\r", ch);
return FALSE;
}
if (get_room_index(value) != NULL)
{
send_to_char("{YREdit: Room vnum already exists.\n\r", ch);
return FALSE;
}
pRoom = new_room_index();
pRoom->area = pArea;
pRoom->vnum = value;
if (value > top_vnum_room) top_vnum_room = value;
iHash = value % MAX_KEY_HASH;
pRoom->next = room_index_hash[iHash];
room_index_hash[iHash] = pRoom;
set_editor( ch->desc, ED_ROOM, pRoom );
SET_BIT(pArea->area_flags, AREA_CHANGED);
send_to_char("Room created.\n\r", ch);
return TRUE;
}
void do_redit (CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA *pRoom;
char arg1[MIL];
argument = one_argument (argument, arg1);
pRoom = ch->in_room;
if (!str_cmp (arg1, "reset"))
{
if (!IS_BUILDER (ch, pRoom->area))
{
send_to_char ("{yInsufficant security to modify room.\n\r", ch);
return;
}
reset_room (pRoom);
send_to_char ("Room reset.\n\r", ch);
return;
}
else if (!str_cmp (arg1, "create"))
{
if (argument[0] == '\0' || atoi (argument) == 0)
{
{
send_to_char ("{ySyntax : redit room create [vnum]\n\r", ch);
return;
}
if (redit_create (ch, argument))
{
char_from_room (ch);
char_to_room (ch, ch->desc->pEdit);
SET_BIT (pRoom->area->area_flags, AREA_CHANGED);
pRoom = ch->in_room;
}
}
else if ( arg1[0] != '\0' )
{
pRoom = get_room_index (atoi (arg1));
if ( pRoom == NULL )
{
send_to_char( "{yRoom inexsistant.\n\r", ch );
return;
}
}
if (!IS_BUILDER (ch, pRoom->area))
{
send_to_char ("{yInsufficiant security to edit this area.\n\r",ch);
return;
}
if ( pRoom == NULL )
bugf( "do_redit : NULL pRoom, ch %s!", ch->name );
if (ch->in_room != pRoom)
{
char_from_room(ch);
char_to_room(ch, pRoom);
}
set_editor(ch->desc, ED_ROOM, pRoom);
return;
}
I've been reading this site for a while now as i have been playing with code on and off for a few years. I finally settled on low4. I dont know why just like the feel of it although i do have a few problems that i could really use some advice on.
I'll admit first of all i am just a tinkerer at present but learning the right way with the books, but these things are a litlle irritating when you dont know how to fix them let alone where to look to find them.
1) Mud Base Colour.
I found it once a while back and i remember physically slapping myself when i found out how to do it. Its the code that changes the mud from its stock green colour. I've plum forgotten where the code is for that let alone how i cracked it. (Old age sucks)
If anyone can help me on this please do!
2) LoW4 OLC
I hate OLC at the best of times but the copy i have seems to have a bug in the redit program.
You can create a new area fine with the vnums set as they should be.
When you go to create a room in that area it changes the vnum 33000 to -32536. Yep thats a negative value.
Which of course the mud doesnt like so it dumps you in limbo when you try to asave and copyover over with the vnum 33000 not existing.
I wondered if anyone else has had this problem and if so where the problem is.
Thanks for taking the time to read this and thanks for any help you guys can give.