void oedit_setup_existing(struct descriptor_data *d, int real_num) { struct obj_data *obj; /* * Allocate object in memory. */ CREATE(obj, struct obj_data, 1); copy_object(obj, &obj_proto[real_num]); /* * Attach new object to player's descriptor. */ OLC_OBJ(d) = obj; OLC_VAL(d) = 0; OLC_ITEM_TYPE(d) = OBJ_TRIGGER; dg_olc_script_copy(d); /* * The edited obj must not have a script. * It will be assigned to the updated obj later, after editing. */ SCRIPT(obj) = NULL; OLC_OBJ(d)->proto_script = NULL; oedit_disp_menu(d); }
void medit_setup_existing(struct descriptor_data *d, int rmob_num) { struct char_data *mob; /* Allocate a scratch mobile structure. */ CREATE(mob, struct char_data, 1); copy_mobile(mob, mob_proto + rmob_num); OLC_MOB(d) = mob; OLC_ITEM_TYPE(d) = MOB_TRIGGER; dg_olc_script_copy(d); /* * The edited mob must not have a script. * It will be assigned to the updated mob later, after editing. */ SCRIPT(mob) = NULL; OLC_MOB(d)->proto_script = NULL; }
void medit_setup_existing(struct descriptor_data *d, int rmob_num) { struct char_data *mob; #if defined(OASIS_MPROG) MPROG_DATA *temp; MPROG_DATA *head; #endif /* * Allocate a scratch mobile structure. */ CREATE(mob, struct char_data, 1); copy_mobile(mob, mob_proto + rmob_num); #if defined(OASIS_MPROG) /* * I think there needs to be a brace from the if statement to the #endif * according to the way the original patch was indented. If this crashes, * try it with the braces and report to [email protected] on if that works. */ if (GET_MPROG(mob)) CREATE(OLC_MPROGL(d), MPROG_DATA, 1); head = OLC_MPROGL(d); for (temp = GET_MPROG(mob); temp;temp = temp->next) { OLC_MPROGL(d)->type = temp->type; OLC_MPROGL(d)->arglist = str_dup(temp->arglist); OLC_MPROGL(d)->comlist = str_dup(temp->comlist); if (temp->next) { CREATE(OLC_MPROGL(d)->next, MPROG_DATA, 1); OLC_MPROGL(d) = OLC_MPROGL(d)->next; } } OLC_MPROGL(d) = head; OLC_MPROG(d) = OLC_MPROGL(d); #endif OLC_MOB(d) = mob; OLC_ITEM_TYPE(d) = MOB_TRIGGER; dg_olc_script_copy(d); medit_disp_menu(d); }