New mail system, with inbox OLC, index rebuilder and initial mail

This commit is contained in:
JamDog 2010-12-06 18:40:28 +00:00
parent d257dc0c75
commit e068bfd5c0
28 changed files with 4085 additions and 588 deletions

View file

@ -22,6 +22,7 @@
#include "class.h"
#include "fight.h"
#include "quest.h"
#include "mail.h"
/* local file scope variables */
static int extractions_pending = 0;
@ -765,6 +766,37 @@ void obj_from_obj(struct obj_data *obj)
obj->next_content = NULL;
}
/* Attach an object into a mudmail */
void obj_to_mail(struct obj_data *object, struct mail_data *mail)
{
if (!object || !mail)
log("SYSERR: Illegal value(s) passed to obj_to_mail. (Mail ID %ld, obj %p)", mail ? mail->mail_id : 0, object);
else {
object->next_content = mail->attachment;
mail->attachment = object;
IN_MAIL(object) = mail;
IN_ROOM(object) = NOWHERE;
object->carried_by = NULL;
}
}
/* Take an object from a mudmail */
void obj_from_mail(struct obj_data *object)
{
struct obj_data *temp;
if (!object || IN_ROOM(object) != NOWHERE || object->carried_by) {
log("SYSERR: NULL object (%p) or obj not attached to a mail passed to obj_from_mail", object);
return;
}
REMOVE_FROM_LIST(object, (IN_MAIL(object))->attachment, next_content);
IN_MAIL(object) = NULL;
IN_ROOM(object) = NOWHERE;
object->next_content = NULL;
}
/* Set all carried_by to point to new owner */
void object_list_new_owner(struct obj_data *list, struct char_data *ch)
{