[ScryMUD] SVN Commit Info r830 - in trunk/mud: grrmud/server lib/containers
scrymud at wanfear.com
scrymud at wanfear.com
Wed Jun 21 18:46:43 PDT 2006
Author: eroper
Date: 2006-06-21 18:46:37 -0700 (Wed, 21 Jun 2006)
New Revision: 830
Modified:
trunk/mud/grrmud/server/ar_skll.cc
trunk/mud/grrmud/server/batl_prc.cc
trunk/mud/grrmud/server/battle.cc
trunk/mud/grrmud/server/command2.cc
trunk/mud/grrmud/server/command3.cc
trunk/mud/grrmud/server/command4.cc
trunk/mud/grrmud/server/command5.cc
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/critter.cc
trunk/mud/grrmud/server/dam_skll.cc
trunk/mud/grrmud/server/dam_spll.cc
trunk/mud/grrmud/server/door.cc
trunk/mud/grrmud/server/ez_skll.cc
trunk/mud/grrmud/server/ez_spll.cc
trunk/mud/grrmud/server/login.cc
trunk/mud/grrmud/server/misc.cc
trunk/mud/grrmud/server/misc2.cc
trunk/mud/grrmud/server/olc.cc
trunk/mud/grrmud/server/olc2.cc
trunk/mud/grrmud/server/pet_spll.cc
trunk/mud/grrmud/server/rm_spll.cc
trunk/mud/grrmud/server/room.cc
trunk/mud/grrmud/server/skills.cc
trunk/mud/grrmud/server/socials.cc
trunk/mud/grrmud/server/spec_prc.cc
trunk/mud/grrmud/server/spells.cc
trunk/mud/grrmud/server/spells2.cc
trunk/mud/grrmud/server/tmp_socials.cc
trunk/mud/grrmud/server/trv_spll.cc
trunk/mud/grrmud/server/vehicle.cc
trunk/mud/grrmud/server/wep_skll.cc
trunk/mud/grrmud/server/zone.cc
trunk/mud/lib/containers/PtrArray.cc
trunk/mud/lib/containers/PtrArray.h
trunk/mud/lib/containers/list2.h
Log:
** WARNING ** This commit will ** NOT ** build.
This is the beginning of a series of code changes necessary to make gcc >= 3.4
happy with the code.
Ed
Modified: trunk/mud/grrmud/server/ar_skll.cc
===================================================================
--- trunk/mud/grrmud/server/ar_skll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/ar_skll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -73,7 +73,7 @@
while ((ptr = ROOM.findNextSpellCritter())) {
if (ptr != &pc) {
if (ptr->mob ||
- (ptr->pc && HaveData(ptr, pc.IS_FIGHTING))) {
+ (ptr->pc && pc.IS_FIGHTING.haveData(ptr))) {
if (ptr->pc && ptr->PC_FLAGS.get(7)) { //if !hassle
continue;
@@ -87,7 +87,7 @@
if (!ptr) { //mirror was hit probably
continue;
}//if
- if (!HaveData(ptr, pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.haveData(ptr)) {
join_in_battle(pc, *ptr);
}//if
Modified: trunk/mud/grrmud/server/batl_prc.cc
===================================================================
--- trunk/mud/grrmud/server/batl_prc.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/batl_prc.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -153,7 +153,7 @@
violence = defense = 0;
}//else
- critter* primary_targ = Top(pc.IS_FIGHTING);
+ critter* primary_targ = pc.IS_FIGHTING.peekFront();
if (!primary_targ)
return; //why are we here??
@@ -738,7 +738,7 @@
while ((ptr = cll.next())) {
if (a_will_help_b_against_c(*ptr, vict, pc)) {
- Put(ptr, tmp_lst);
+ tmp_lst.append(ptr);
}//if
}//while
@@ -814,7 +814,7 @@
critter* find_weakest(List<critter*>& lst) {
Cell<critter*> cll(lst);
critter* ptr;
- critter* weakest = Top(lst);
+ critter* weakest = lst.peekFront();
while ((ptr = cll.next())) {
if (ptr == weakest)
@@ -828,14 +828,14 @@
short is_tank(critter& pc) {
- if (IsEmpty(pc.IS_FIGHTING))
+ if (pc.IS_FIGHTING.peekFront())
return FALSE;
Cell<critter*> cll(pc.IS_FIGHTING);
critter* ptr;
while ((ptr = cll.next())) {
- if (Top(ptr->IS_FIGHTING) == &pc) {
+ if (ptr->IS_FIGHTING.peekFront() == &pc) {
return TRUE;
}//if
}//while
Modified: trunk/mud/grrmud/server/battle.cc
===================================================================
--- trunk/mud/grrmud/server/battle.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/battle.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -159,7 +159,7 @@
for (i = 0; i< atks; i++) {
if (!crit_ptr->IS_FIGHTING.isEmpty()) {
//if first hit kills, abort
- vict_ptr = Top(crit_ptr->IS_FIGHTING);
+ vict_ptr = crit_ptr->IS_FIGHTING.peekFront();
if (mudlog.ofLevel(DBG)) {
mudlog << "In do_battle, within for loop, i: "
@@ -211,7 +211,7 @@
*crit_ptr)) *
(float)(crit_ptr->getDEX(TRUE)) / 10.0));
if (d(1,100) < d(1, val)-(crit_ptr->PAUSE*50) ) {
- vict_ptr = Top(crit_ptr->IS_FIGHTING);
+ vict_ptr = crit_ptr->IS_FIGHTING.peekFront();
if (vict_ptr->isUsingClient()) {
vict_ptr->show(CTAG_BATTLE(vict_ptr->whichClient()));
@@ -1025,7 +1025,7 @@
// no exp gain in a coliseum
if (!agg.getCurRoom()->isColiseum()) {
- if (IsEmpty(agg.GROUPEES)) { //solitary person
+ if (agg.GROUPEES.isEmpty()) { //solitary person
gain_xp(agg, xp_to_be_gained, TRUE);
}//if
else { //in a group
@@ -1314,7 +1314,7 @@
gold->cur_stats[1] = vict.GOLD; //transfer gold
vict.GOLD = 0;
- Put(gold, corpse->inv);
+ corpse->inv.append(gold);
}//if
/* eq */
@@ -1323,7 +1323,7 @@
remove_eq_effects(*(vict.EQ[i]), vict, TRUE, FALSE, i);
if (vict.EQ[i]->IN_LIST)
vict.EQ[i]->IN_LIST = &(corpse->inv);
- Put(vict.EQ[i], corpse->inv);
+ corpse->inv.append(vict.EQ[i]);
vict.EQ[i] = NULL;
}//if
}//for
@@ -1346,7 +1346,7 @@
while ((o_ptr = ocell.next())) {
if (o_ptr->IN_LIST)
o_ptr->IN_LIST = &(corpse->inv);
- Put(o_ptr, corpse->inv);
+ corpse->inv.append(o_ptr);
}//while
vict.PERM_INV.clear(); //should NEVER be SOBJ's
}//if
@@ -1363,7 +1363,7 @@
vict.getCurRoomNum());
recursive_init_loads(*ptr, 0);
- ptr->names.append(new String(*(Top(vict.names))));
+ ptr->names.append(new String(*(vict.names.peekFront())));
Sprintf(buf, "the severed head of %S",
vict.getName());
@@ -1400,11 +1400,11 @@
recursive_init_loads(*ptr, 0);
- ptr->names.append(new String(*(Top(vict.names))));
- Sprintf(buf, "the tattered skin of %S", Top(vict.names));
+ ptr->names.append(new String(*(vict.names.peekFront())));
+ Sprintf(buf, "the tattered skin of %S", vict.names.peekFront());
ptr->short_desc = buf;
Sprintf(buf, "The tattered skin of %S lies here.",
- Top(vict.names));
+ vict.names.peekFront());
ptr->in_room_desc = buf;
Sprintf(buf,
"This large piece of %s skin was recently hacked from the corpse of %S.\n"
Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/command2.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -87,7 +87,7 @@
get_race_name(of_pc.RACE));
show(buf, pc);
- if (!IsEmpty(of_pc.affected_by)) {
+ if (!of_pc.affected_by.isEmpty()) {
pc.show(CS_AFFECTED_BY);
while ((ss_ptr = cll.next())) {
Sprintf(buf, "\t%s.\n",
@@ -99,7 +99,7 @@
pc.show(CS_NOT_AFFECTED_SPELLS);
}//else
- if (!IsEmpty(of_pc.pets)) {
+ if (!of_pc.pets.isEmpty()) {
pc.show(CS_HAVE_PETS);
out_crit(of_pc.pets, pc, TRUE); //show them all, detect or not.
}//if
@@ -253,9 +253,9 @@
pc.show(CS_OWN_MASTER);
}
- if (!IsEmpty(pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.isEmpty()) {
Sprintf(buf2, cstr(CS_YOU_FIGHTING, pc),
- name_of_crit(*(Top(pc.IS_FIGHTING)), pc.SEE_BIT));
+ name_of_crit(*(pc.IS_FIGHTING.peekFront()), pc.SEE_BIT));
show(buf2, pc);
}//if
return 0;
@@ -1077,7 +1077,7 @@
show(buf, pc);
}//if
else { //ok, got some kind of object...lets test it
- if (IsEmpty(obj_ptr->inv)) {
+ if (obj_ptr->inv.isEmpty()) {
if (mudlog.ofLevel(INF)) {
mudlog << "INFO: container has no inventory, obj# "
<< obj_ptr->getIdNum() << endl;
@@ -1096,7 +1096,7 @@
obj_ptr->getShortName());
show(buf, pc);
}//if
- else if (IsEmpty(obj_ptr->inv)) {
+ else if (obj_ptr->inv.isEmpty()) {
Sprintf(buf, cstr(CS_NO_LIQ_IN_CONT, pc),
&(obj_ptr->short_desc));
buf.Cap();
@@ -1111,13 +1111,13 @@
obj2 = obj_to_sobj(*obj_ptr, ROOM.getInv(), TRUE, i_th,
name, pc.SEE_BIT, ROOM);
}//else
- object* obj3 = Top(obj2->inv);
+ object* obj3 = obj2->inv.peekFront();
obj2->CHARGES--;
consume_eq_effects(*obj3, pc, TRUE);
return 0;
}//if
else {
- obj2 = Top(obj_ptr->inv);
+ obj2 = obj_ptr->inv.peekFront();
obj_ptr->CHARGES--;
consume_eq_effects(*obj2, pc, TRUE);
return 0;
@@ -1182,7 +1182,7 @@
}//if
/* so both are containers */
- else if ((Top(targ_obj->inv) != Top(source_obj->inv)) &&
+ else if ((targ_obj->inv.peekFront() != source_obj->inv.peekFront()) &&
(targ_obj->extras[0] != 0)) {
Sprintf(buf, cstr(CS_MUST_EMPTY, pc),
name_of_obj(*targ_obj, pc.SEE_BIT));
@@ -1226,7 +1226,7 @@
clear_obj_list(targ_obj->inv);
//TODO, check for SOBJ: Answer, allways use OBJ, not SOBJ
- targ_obj->gainInv(&(obj_list[Top(source_obj->inv)->getIdNum()]));
+ targ_obj->gainInv(&(obj_list[source_obj->inv.peekFront()->getIdNum()]));
/* test for infinite source */
if (source_obj->extras[0] <= -1) {
@@ -1301,19 +1301,19 @@
if (!(obj_ptr->OBJ_FLAGS.get(59))) {
Sprintf(buf, cstr(CS_NOT_LIQ_CONT_EMPTY, pc),
- Top(obj_ptr->names));
+ obj_ptr->names.peekFront());
show(buf, pc);
}//if
/* got a valid canteen */
else if (obj_ptr->extras[0] == 0) {
Sprintf(buf, cstr(CS_CONT_EMPTY_SPRINTF, pc),
- Top(obj_ptr->names));
+ obj_ptr->names.peekFront());
show(buf, pc);
}//if
else if (obj_ptr->extras[0] == -1) {
Sprintf(buf, cstr(CS_NEVER_EMPTY, pc),
- Top(obj_ptr->names));
+ obj_ptr->names.peekFront());
show(buf, pc);
}//if
/* ok, procede w/emptying */
@@ -2487,7 +2487,7 @@
}//if a mob
/* pc data */
- if (!IsEmpty(crit_ptr->IS_FIGHTING)) {
+ if (!crit_ptr->IS_FIGHTING.isEmpty()) {
Sprintf(buf2, "%S is fighting:\n", name_of_crit(*crit_ptr, ~0));
show(buf2, pc);
out_crit(crit_ptr->IS_FIGHTING, pc);
Modified: trunk/mud/grrmud/server/command3.cc
===================================================================
--- trunk/mud/grrmud/server/command3.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/command3.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -154,7 +154,7 @@
{
found_proc = TRUE;
if (target->Strlen() == 0) {
- targ = Top(pc.IS_FIGHTING);
+ targ = pc.IS_FIGHTING.peekFront();
}//if
else {
targ = ROOM.haveCritNamed(j_th, target, pc.SEE_BIT);
@@ -487,7 +487,7 @@
mudlog.dbg("Requires mob for target.\n");
found_proc = TRUE;
if (vict->Strlen() == 0) {
- targ = Top(pc.IS_FIGHTING);
+ targ = pc.IS_FIGHTING.peekFront();
}//if
else {
targ = ROOM.haveCritNamed(j_th, vict, pc.SEE_BIT);
@@ -965,7 +965,7 @@
return -1;
}
obj_list[new_obj] = obj_list[obj_ptr->OBJ_NUM];
- Sprintf(buf, "CLONE OF: %S.", Top(obj_ptr->names));
+ Sprintf(buf, "CLONE OF: %S.", obj_ptr->names.peekFront());
obj_list[new_obj].in_room_desc = buf;
obj_list[new_obj].short_desc = buf;
obj_list[new_obj].OBJ_NUM = new_obj;
@@ -1431,7 +1431,7 @@
}//if
mob_list[new_num] = mob_list[crit_ptr->MOB_NUM]; //make a copy
- Sprintf(buf, "CLONE OF: %S.", Top(crit_ptr->names));
+ Sprintf(buf, "CLONE OF: %S.", crit_ptr->names.peekFront());
mob_list[new_num].in_room_desc = buf;
mob_list[new_num].short_desc = buf;
mob_list[new_num].setIdNum(new_num);
@@ -1576,7 +1576,7 @@
show("You can't flee sitting on your butt!\n", pc);
}//if
else { //lets try it
- if ((crit_ptr = Top(pc.IS_FIGHTING))) { //ie in battle
+ if ((crit_ptr = pc.IS_FIGHTING.peekFront())) { //ie in battle
if (crit_ptr->mob && !crit_ptr->isStunned()) { //if its a mob
if (crit_ptr->MOB_FLAGS.get(10) && (d(1,100) > 12)) { //if !flee
Sprintf(buf, "%S prevents you from fleeing.\n",
@@ -1626,7 +1626,8 @@
}
if ((dr_ptr = door::findDoor(ROOM.doors, 1,
- Top(door_list[d(1,10)].names), ~0, ROOM))) {
+ door_list[d(1,10)].names.peekFront(),
+ ~0, ROOM))) {
if (dr_ptr->isOpen()) {
break; //weee hoooo, found a good one!
}//if
@@ -1681,7 +1682,8 @@
}
if ((dr_ptr = door::findDoor(ROOM.doors, 1,
- Top(door_list[d(1,10)].names), ~0, ROOM))) {
+ door_list[d(1,10)].names.peekFront(),
+ ~0, ROOM))) {
if (!(dr_ptr->dr_data->door_data_flags.get(2))) {
break; //weee hoooo, found a good one!
}//if
@@ -1692,7 +1694,8 @@
Sprintf(buf, "tries to flee %S!",
direction_of_door(*dr_ptr));
emote(buf, pc, ROOM, FALSE);
- move(pc, 1, *(Top(dr_ptr->dr_data->names)), FALSE, ROOM, is_dead);
+ move(pc, 1, *( dr_ptr->dr_data->names.peekFront() ),
+ FALSE, ROOM, is_dead);
if (is_dead)
return 0;
@@ -1853,7 +1856,7 @@
// the new owner of a pet can push him around
doUngroup(1, &NULL_STRING); //ungroup the pet first...
doBecomeNonPet();
- Put(this, vict.PETS);
+ vict.PETS.append(this);
MASTER=&vict;
}
else if (FOLLOWER_OF) { // if possibly part of a group
@@ -1898,7 +1901,7 @@
if (vict->Strlen() == 0) { //display group
- if (IsEmpty(pc.GROUPEES)) {
+ if (pc.GROUPEES.isEmpty()) {
show("You are a party of one!\n", pc);
return -1;
}//if
@@ -2036,7 +2039,7 @@
}//if
if (i == -1) { //if order fol <cmd_string>
- if (IsEmpty(pc.PETS)) {
+ if (pc.PETS.isEmpty()) {
show("But, you have no pets!\n", pc);
return -1;
}//if
@@ -2068,7 +2071,7 @@
else {
ptr = ROOM.haveCritNamed(i, &name, pc.SEE_BIT);
if (ptr) {
- if (HaveData(ptr, pc.PETS)) {
+ if (pc.PETS.haveData(ptr)) {
String cmd = "order";
ROOM.checkForProc(cmd, *str, pc, ptr->MOB_NUM);
@@ -2248,7 +2251,7 @@
}//if
}//if
- Put(ptr, pc.PETS);
+ pc.PETS.append(ptr);
ptr->MASTER = &pc;
ptr->doFollow(pc);
Modified: trunk/mud/grrmud/server/command4.cc
===================================================================
--- trunk/mud/grrmud/server/command4.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/command4.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -366,7 +366,7 @@
while ((msg = cll.next())) {
msg->names.clearAndDestroy();
Sprintf(buf, "%i", i);
- Put(new String(buf), msg->names);
+ msg->names.append(new String(buf));
msg->names.append(new String(cstr(CS_MESSAGE, pc)));
buf = msg->short_desc.Get_Command(eos, term_by_period);
Sprintf(buf, "Message_%i", i);
@@ -469,7 +469,7 @@
String* name = new String(20);
Sprintf(*name, "%i", i);
- Put(name, (pc.pc->post_msg->names));
+ pc.pc->post_msg->names.append(name);
Sprintf(buf, "message_%i", i);
name = new String(buf);
pc.pc->post_msg->names.append(name);
@@ -508,7 +508,7 @@
ptr->OBJ_NUM); //move it back to right name
system(buf);
- Put(pc.pc->post_msg, ptr->inv);
+ ptr->inv.append(pc.pc->post_msg);
pc.pc->post_msg = NULL;
}//else
@@ -532,7 +532,7 @@
if (!pc.pc)
return -1;
- if (!IsEmpty(pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.isEmpty()) {
pc.show("You must stop fighting first.\n", HL_DEF);
return -1;
}//if
@@ -1115,7 +1115,7 @@
int num_of_generic_door(const String* direction) {
String* tmp_name;
for (int i = 1; i <= 10; i++) {
- tmp_name = Top(door_list[i].names);
+ tmp_name = door_list[i].names.peekFront();
if (strcasecmp(*direction, *tmp_name) == 0)
return i;
}//for
@@ -1221,7 +1221,7 @@
<< "Adding to affected_rooms bcause of gate." << endl;
affected_rooms.gainData(&cur_room);
}//if
- Put(new_door, cur_room.doors);
+ cur_room.doors.append(new_door);
if (!is_gate)
show("OK, doors added (its reflexive now)\n", pc);
return 0;
@@ -1237,7 +1237,7 @@
if (!check_l_range(nd_num, 0, NUMBER_OF_DOORS, pc, TRUE))
return -1;
- if (IsEmpty(door_list[nd_num].names)) {
+ if (door_list[nd_num].names.isEmpty()) {
show("That door doesn't exist yet.\n", pc);
return -1;
}//if
@@ -1342,7 +1342,7 @@
for (j = ZoneCollection::instance().elementAt(znum).getBeginRoomNum();
j <= ZoneCollection::instance().elementAt(znum).getEndRoomNum();
j++) {
- if (!IsEmpty(room_list[j].names)) {
+ if (!room_list[j].names.isEmpty()) {
room_list[j].dbWrite();
}
}
@@ -1364,7 +1364,7 @@
for (j = ZoneCollection::instance().elementAt(znum).getBeginRoomNum();
j <= ZoneCollection::instance().elementAt(znum).getEndRoomNum();
j++) {
- if (!IsEmpty(room_list[j].names)) {
+ if (!room_list[j].names.isEmpty()) {
if (room_list[j].isVehicle()) {
rfile << (j | 0x01000000) << "\t\tVehicle number\n";
}
@@ -1785,7 +1785,7 @@
}//if
for (int i = start; i<= end; i++) {
- if (!IsEmpty(room_list[i].names)) {
+ if (!room_list[i].names.isEmpty()) {
Sprintf(buf, "\t%i\t%S\n", i, &(room_list[i].short_desc));
show(buf, pc);
}//if
@@ -1820,7 +1820,7 @@
}//if
for (int i = start; i<= end; i++) {
- if (!IsEmpty(door_list[i].names)) {
+ if (!door_list[i].names.isEmpty()) {
Sprintf(buf, "\t%i\t%S\n", i, &(door_list[i].long_desc));
show(buf, pc);
}//if
Modified: trunk/mud/grrmud/server/command5.cc
===================================================================
--- trunk/mud/grrmud/server/command5.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/command5.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -1108,14 +1108,14 @@
else if (pc.POS > POS_REST) {
show("You are too relaxed.\n", pc);
}//if
- else if (!IsEmpty(pc.IS_FIGHTING)) {
+ else if (!pc.IS_FIGHTING.isEmpty()) {
show("You find it hard to have a decent conversation while fighting!\n",
pc);
}//if
else { //looks like we're good to go
if (ptr->mob && !ptr->pc) {
if (ptr->mob->proc_data) {
- if (!IsEmpty(ptr->mob->proc_data->topics)) { //then do it
+ if (!ptr->mob->proc_data->topics.isEmpty()) { //then do it
if (ptr->isMob()) {
ptr = mob_to_smob(*ptr, pc.getCurRoomNum(), TRUE, i_th, targ, pc.SEE_BIT);
}//if
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/commands.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -418,7 +418,7 @@
pc.inv.head(cell);
obj_ptr = cell.next();
- if (IsEmpty(pc.inv)) {
+ if (pc.inv.isEmpty()) {
pc.show(CS_NOTHING_TO_WEAR);
}//if
else {
@@ -2618,7 +2618,7 @@
return 0;
}//if
if (pc.POS < POS_REST) {
- if (IsEmpty(pc.IS_FIGHTING)) {
+ if (pc.IS_FIGHTING.isEmpty()) {
pc.show(CS_DO_REST);
emote(CS_REST_EMOTE, pc, ROOM, FALSE);
pc.setPosn(POS_REST); //rest
@@ -2652,7 +2652,7 @@
return 0;
}//if
if ((pc.POS < POS_REST) || (pc.POS == POS_PRONE)) {
- if (IsEmpty(pc.IS_FIGHTING)) {
+ if (pc.IS_FIGHTING.isEmpty()) {
pc.show(CS_DO_SIT);
emote(CS_SIT_EMOTE, pc, ROOM, FALSE);
pc.setPosn(POS_SIT);
@@ -2721,7 +2721,7 @@
return 0;
}//if
else if ((pc.POS <= POS_MED)) {
- if (IsEmpty(pc.IS_FIGHTING)) {
+ if (pc.IS_FIGHTING.isEmpty()) {
pc.show(CS_DO_SLEEP);
emote(CS_EMOTE_SLEEP, pc, ROOM, FALSE);
pc.setPosn(POS_SLEEP);
@@ -2754,7 +2754,7 @@
return 0;
}//if
else if ((pc.POS != POS_SLEEP)) {
- if (IsEmpty(pc.IS_FIGHTING)) {
+ if (pc.IS_FIGHTING.isEmpty()) {
if (d(1, 75) < d(1, get_percent_lrnd(MEDITATION_SKILL_NUM, pc))) {
pc.show(CS_DO_MED);
emote(CS_MED_EMOTE, pc, ROOM, FALSE);
@@ -2880,7 +2880,7 @@
else if (pc.POS != POS_STAND) {
pc.show(CS_MOV_STANDING);
}//if
- else if (!IsEmpty(pc.IS_FIGHTING)) { //if fighting
+ else if (!pc.IS_FIGHTING.isEmpty()) { //if fighting
pc.show(CS_MOV_FIGHTING);
}//if
else if ((door_ptr = door::findDoor(rm.DOORS, i_th, &str_dir, ~0, rm))) {
@@ -2926,7 +2926,7 @@
if (ptr2->mob) {
if (ptr2->mob->proc_data) {
if (ptr2->mob->proc_data->int1 != 0) {
- if (strcasecmp(*(Top(door_list[ptr2->INT1].names)),
+ if (strcasecmp(*(door_list[ptr2->INT1].names.peekFront()),
*(direction_of_door(*door_ptr))) == 0) {
if ((ptr2->FLAG1.get(3) && (ptr2->CLASS == pc.CLASS)) ||
(ptr2->FLAG1.get(4) && (ptr2->RACE == pc.RACE))) {
Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/critter.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -1136,7 +1136,7 @@
MobScript* ptr;
while ((ptr = cll.next())) {
- Put(new MobScript(*ptr), mob_proc_scripts);
+ mob_proc_scripts.append(new MobScript(*ptr));
}
return *this;
@@ -1239,7 +1239,7 @@
ptr = new MobScript();
ptr->read(ofile);
- Put(ptr, mob_proc_scripts);
+ mob_proc_scripts.append(ptr);
ofile >> sent_;
ofile.getline(tmp, 80);
if (mudlog.ofLevel(DB))
@@ -1833,7 +1833,7 @@
Cell<String*> scll(source.names);
String* sptr;
while ((sptr = scll.next())) {
- Put((new String(*sptr)), names);
+ names.append(new String(*sptr));
}//while
short_desc = source.short_desc;
@@ -1884,13 +1884,13 @@
while ((tmp_stat = cell.next())) {
tmp_stat2 = new stat_spell_cell;
*tmp_stat2 = *tmp_stat; //shallow copy should work
- Put(tmp_stat2, mini_affected_by);
+ mini_affected_by.append(tmp_stat2);
}//while
source.inv.head(cll);
while ((obj_ptr = cll.next())) {
if (!obj_ptr->IN_LIST) { //no multiple ptrs to SOBJ's
- Put(obj_ptr, inv);
+ inv.append(obj_ptr);
}//if
}//while
@@ -2183,7 +2183,7 @@
int iter = min(path.size(), num_steps);
- for (int i = 0; ((i < iter) && (IsEmpty(IS_FIGHTING))); i++) {
+ for (int i = 0; ((i < iter) && (IS_FIGHTING.isEmpty())); i++) {
int next_room = path.popFront();
String* dir = dir_of_room(*(getCurRoom()), next_room);
@@ -3041,7 +3041,7 @@
return;
} // if
while ((row=mysql_fetch_row(result))) {
- Put(new String(row[0]), names);
+ names.append(new String(row[0]));
} // while
mysql_free_result(result);
} // if
@@ -3121,7 +3121,7 @@
ss_ptr = new stat_spell_cell;
ss_ptr->stat_spell = atoi(row[0]);
ss_ptr->bonus_duration = atoi(row[1]);
- Put(ss_ptr, affected_by);
+ affected_by.append(ss_ptr);
} // while
mysql_free_result(result);
} // if
@@ -3158,14 +3158,14 @@
object* new_obj = new object;
new_obj->dbRead(obj_num, sobj_num, read_all);
new_obj->IN_LIST = &inv;
- Put(new_obj, inv);
+ inv.append(new_obj);
affected_objects.append(new_obj);
} // if
else {
if (obj_list[obj_num].OBJ_FLAGS.get(OBJFLAG_IN_USE)) {
if (read_all || ((obj_list[obj_num].OBJ_PRCNT_LOAD *
config.currentLoadModifier)/100) > d(1, 100)) {
- Put(&obj_list[obj_num], inv);
+ inv.append(&obj_list[obj_num]);
} // if
} // if
else {
@@ -3403,7 +3403,7 @@
ptr->appendCmd(*tmp_str);
delete tmp_str;
} // while
- Put(ptr, mob->mob_proc_scripts);
+ mob->mob_proc_scripts.append(ptr);
ptr->compile();
} // while
mysql_free_result(result);
@@ -3556,7 +3556,7 @@
}//if
else {
string = new String(tmp_str);
- Put(string, names);
+ names.append(string);
}//else
}//while
ofile.getline(tmp, 80);
@@ -3650,7 +3650,7 @@
ofile >> ss_ptr->bonus_value;
}
- Put(ss_ptr, affected_by);
+ affected_by.append(ss_ptr);
ofile >> i;
}//while
ofile.getline(tmp, 80);
@@ -3689,7 +3689,7 @@
new_obj->fileRead(ofile, TRUE);
new_obj->IN_LIST = &(inv); //make sure its a SOBJ
- Put(new_obj, inv); //add it to inventory
+ inv.append(new_obj); // add it to inventory
affected_objects.append(new_obj);
}//if
@@ -3698,7 +3698,7 @@
if (read_all ||
((obj_list[i].OBJ_PRCNT_LOAD * config.currentLoadModifier)/100) >
d(1,100)) {
- Put(&(obj_list[i]), inv); //add it to inventory
+ inv.append(&(obj_list[i])); //add it to inventory
}//if
}//if
else {
@@ -4233,7 +4233,7 @@
mudlog << "In doSuicide, pc: " << *(getName()) << endl;
}
- buf = *(Top(names));
+ buf = *(names.peekFront());
buf.Tolower();
buf.Prepend("rm ./Pfiles/");
system(buf);
Modified: trunk/mud/grrmud/server/dam_skll.cc
===================================================================
--- trunk/mud/grrmud/server/dam_skll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/dam_skll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -46,7 +46,7 @@
}
if (!victim->Strlen()) {
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
if (crit_ptr && !detect(pc.SEE_BIT, crit_ptr->VIS_BIT))
crit_ptr = NULL;
}//if
@@ -102,7 +102,7 @@
return -1;
}//if
- if (!HaveData(&vict, pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.haveData(&vict)) {
join_in_battle(pc, vict);
}//if
@@ -128,7 +128,8 @@
pc.PAUSE += d(1,3);
if ((dptr = door::findDoor(ROOM.DOORS, 1,
- Top(door_list[d(1,10)].names), ~0, ROOM)) &&
+ door_list[d(1,10)].names.peekFront(),
+ ~0, ROOM)) &&
!(dptr->dr_data->door_data_flags.get(2))) {
Sprintf(buf, "hurls %S out of the room.\n", name_of_crit(vict, ~0));
emote(buf, pc, ROOM, TRUE, &vict);
@@ -231,7 +232,7 @@
}
if (!victim->Strlen()) {
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
if (crit_ptr && !detect(pc.SEE_BIT, crit_ptr->VIS_BIT))
crit_ptr = NULL;
}//if
@@ -278,7 +279,7 @@
return -1;
}//if
- if (!HaveData(&vict, pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.haveData(&vict)) {
mudlog.log(DBG, "Calling join_in_battle in do_body_slam..\n");
join_in_battle(pc, vict);
}//if
Modified: trunk/mud/grrmud/server/dam_spll.cc
===================================================================
--- trunk/mud/grrmud/server/dam_spll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/dam_spll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -133,7 +133,7 @@
}//else did miss AND vict NOT equal to agg
if (!do_fatality && do_join_in_battle &&
- !HaveData(&victim, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&victim)) {
join_in_battle(agg, victim);
}//if
@@ -232,7 +232,7 @@
pemote(buf, agg, room_list[agg.getCurRoomNum()], TRUE, &victim);
}
}//missed
- if (!do_fatality && do_join_in_battle && !HaveData(&victim, agg.IS_FIGHTING))
+ if (!do_fatality && do_join_in_battle && !agg.IS_FIGHTING.haveData(&victim))
join_in_battle(agg, victim);
if (do_fatality) {
@@ -331,7 +331,7 @@
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -442,7 +442,7 @@
}//did_miss
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -546,7 +546,7 @@
}//did_miss
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -645,7 +645,7 @@
}//did_miss
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -771,7 +771,7 @@
agg.PAUSE += 1;
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -786,7 +786,7 @@
int spell_num = CAUSE_SICKNESS_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
@@ -926,7 +926,7 @@
agg.PAUSE += 1;
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -941,7 +941,7 @@
int spell_num = LIGHTNING_SKILL_NUM;
if (victim->Strlen() == 0)
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
else
vict = ROOM.haveCritNamed(i_th, victim, pc.SEE_BIT);
if (!vict) {
@@ -1081,7 +1081,7 @@
agg.PAUSE += 1;
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -1096,7 +1096,7 @@
int spell_num = DOD_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
@@ -1239,7 +1239,7 @@
agg.PAUSE += 1;
if (!do_fatality && do_join_in_battle &&
- !HaveData(&vict, agg.IS_FIGHTING)) {
+ !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -1254,7 +1254,7 @@
int spell_num = SHOCKING_GRASP_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
@@ -1392,7 +1392,7 @@
}//else
agg.PAUSE += 1;
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -1407,7 +1407,7 @@
int spell_num = RAINBOW_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
@@ -1546,7 +1546,7 @@
}//else
agg.PAUSE += 1;
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -1561,7 +1561,7 @@
int spell_num = BURNING_HANDS_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.is_fighting);
+ vict = pc.is_fighting.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
Modified: trunk/mud/grrmud/server/door.cc
===================================================================
--- trunk/mud/grrmud/server/door.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/door.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -146,7 +146,7 @@
return;
}
while ((row=mysql_fetch_row(result))) {
- Put(new String(row[0]), names);
+ names.append(new String(row[0]));
}
mysql_free_result(result);
}
@@ -200,7 +200,7 @@
}//if
else {
string = new String(tmp_str);
- Put(string, names);
+ names.append(string);
}//else
}//while
da_file.getline(tmp, 80);
@@ -299,7 +299,7 @@
Cell<stat_spell_cell*> cll(source.affected_by);
stat_spell_cell* ptr;
while ((ptr = cll.next())) {
- Put(new stat_spell_cell(*ptr), affected_by);
+ affected_by.append(new stat_spell_cell(*ptr));
}//while
crit_blocking = source.crit_blocking;
@@ -347,7 +347,7 @@
is_affected = TRUE;
da_file >> tmp;
- Put(new stat_spell_cell(i, tmp), affected_by);
+ affected_by.append(new stat_spell_cell(i, tmp));
da_file >> i;
}//while
Modified: trunk/mud/grrmud/server/ez_skll.cc
===================================================================
--- trunk/mud/grrmud/server/ez_skll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/ez_skll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -70,7 +70,7 @@
return -1;
}//if
- if (IsEmpty(vict.IS_FIGHTING)) {
+ if (vict.IS_FIGHTING.isEmpty()) {
Sprintf(buf, "%s isn't fighting anyone!\n", get_he_she(vict));
buf.Cap();
show(buf, pc);
Modified: trunk/mud/grrmud/server/ez_spll.cc
===================================================================
--- trunk/mud/grrmud/server/ez_spll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/ez_spll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -369,8 +369,7 @@
if (sp)
sp->bonus_duration += lvl/2;
else
- Put(new stat_spell_cell(spell_num, lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.SEE_BIT |= 2; //can now see invisible
}//if
}//do_cast_detect_invisibility
@@ -464,8 +463,7 @@
if (sp)
sp->bonus_duration += lvl/2;
else
- Put(new stat_spell_cell(spell_num, lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.SEE_BIT |= 1; //can now see in the dark
}//if
}//do_cast_infravision
@@ -559,8 +557,7 @@
if (sp)
sp->bonus_duration += lvl/2;
else
- Put(new stat_spell_cell(spell_num, lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.SEE_BIT |= 4; //can now see hidden
}//if
}//do_cast_detect_hidden
@@ -654,8 +651,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else {
- Put(new stat_spell_cell(spell_num, 5 + lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, 5 + lvl/2));
vict.HIT += BLESS_EFFECTS;
}//else
}//if
@@ -758,8 +754,7 @@
if (sp)
sp->bonus_duration += lvl/2;
else {
- Put(new stat_spell_cell(spell_num, 10 + lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, 10 + lvl/2));
vict.CRIT_FLAGS.turn_on(25); //pfg now
}//else
}//if
@@ -864,8 +859,7 @@
if (sp)
sp->bonus_duration += lvl/2;
else {
- Put(new stat_spell_cell(spell_num, 10 + lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, 10 + lvl/2));
vict.CRIT_FLAGS.turn_on(24); //pfe now
}//else
}//if
@@ -961,8 +955,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else
- Put(new stat_spell_cell(spell_num, lvl/3),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.PC_FLAGS.turn_on(18); //can now det magic
}//if a pc
}//if
@@ -1027,7 +1020,7 @@
}//if
if (is_canned || (!(lost_con = lost_concentration(agg, spell_num)))) {
- object* obj_ptr = Top(vict.inv);
+ object* obj_ptr = vict.inv.peekFront();
if (obj_ptr && obj_ptr->OBJ_NUM != 7) {
show("You need to empty it first!\n", agg);
return;
@@ -1162,7 +1155,7 @@
// You always get at least one...
if (!ht_ptr)
- Put((ht_ptr = new stat_spell_cell(7, 1)), vict.stat_affects);
+ vict.stat_affects.append((ht_ptr = new stat_spell_cell(7,1)));
else
ht_ptr->bonus_duration++;
@@ -1171,13 +1164,13 @@
ht_ptr = has_stat_affect(7, vict);
if (d(1, 6) == 2) {
if (!dm_ptr)
- Put((dm_ptr = new stat_spell_cell(8, 1)), vict.stat_affects);
+ vict.stat_affects.append((dm_ptr = new stat_spell_cell(8,1)));
else
dm_ptr->bonus_duration++;
}//if
else if (d(1,6) == 6) {
if (!ht_ptr)
- Put((ht_ptr = new stat_spell_cell(7, 1)), vict.stat_affects);
+ vict.stat_affects.append((ht_ptr = new stat_spell_cell(7,1)));
else
ht_ptr->bonus_duration++;
}//else
@@ -1269,13 +1262,13 @@
/* first do AC decrementation */
if (!ac_ptr)
- Put(new stat_spell_cell(9, -(lvl/3)), vict.stat_affects);
+ vict.stat_affects.append(new stat_spell_cell(9, -(lvl/3)));
else
ac_ptr->bonus_duration -= (lvl/3);
/* spell resistance decrementation (less is good) */
if (!spll_ptr)
- Put(new stat_spell_cell(32, -(lvl/3)), vict.stat_affects);
+ vict.stat_affects.append(new stat_spell_cell(32, -(lvl/3)));
else
spll_ptr->bonus_duration -= (lvl/3);
@@ -1364,7 +1357,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else {
- Put(new stat_spell_cell(spell_num, lvl/2), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
}//else
}//if
}//do_cast_fire_blade
@@ -1451,7 +1444,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else {
- Put(new stat_spell_cell(spell_num, lvl/2), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
}//else
}//if
}//do_cast_frost_blade
@@ -1537,7 +1530,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else {
- Put(new stat_spell_cell(spell_num, lvl/2), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.OBJ_DAM_DICE_SIDES += RUNE_EDGE_EFFECTS;
}//else
}//if
@@ -1647,7 +1640,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.VIS_BIT |= 2;
}//if
@@ -1705,7 +1698,7 @@
if (sp)
sp->bonus_duration += lvl/3;
else
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.OBJ_VIS_BIT |= 2;
}//if
@@ -2098,7 +2091,7 @@
int spell_num = ENTANGLE_SKILL_NUM;
if (victim->Strlen() == 0)
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
else
vict = ROOM.haveCritNamed(i_th, victim, pc);
@@ -2130,7 +2123,7 @@
int spell_num = WEB_SKILL_NUM;
if (victim->Strlen() == 0)
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
else
vict = ROOM.haveCritNamed(i_th, victim, pc);
@@ -2240,12 +2233,12 @@
}//if
}//while
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.DEX += WEB_DEX_AUGMENTATION;
vict.MV_REGEN += WEB_MV_REGEN_AUGMENTATION;
}//if
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
}//do_cast_web
@@ -2332,12 +2325,12 @@
}//if
}//while
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.DEX += ENTANGLE_DEX_AUGMENTATION;
vict.MV_REGEN += ENTANGLE_MV_REGEN_AUGMENTATION;
}//if
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
}//do_cast_entangle
@@ -2348,7 +2341,7 @@
int spell_num = FAERIE_FIRE_SKILL_NUM;
if (victim->Strlen() == 0) {
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
if (vict && !detect(pc.SEE_BIT, vict->VIS_BIT))
vict = NULL;
}
@@ -2457,11 +2450,11 @@
}//if
}//while
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.AC += FAERIE_FIRE_AC_AUGMENTATION;
}//if
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
}//do_cast_faerie_fire
Modified: trunk/mud/grrmud/server/login.cc
===================================================================
--- trunk/mud/grrmud/server/login.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/login.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -164,7 +164,7 @@
#endif
case false:
string2 = new String(string);
- Put(string2, (names));
+ names.append(string2);
name = string;
name.Tolower();
name.Prepend("./Pfiles/");
@@ -474,11 +474,13 @@
critter* old_ptr;
old_ptr = have_crit_named(linkdead_list, 1,
- Top((names)), ~0, *(getCurRoom()),
+ names.peekFront(),
+ ~0, *(getCurRoom()),
TRUE);
if (!old_ptr) {
old_ptr = have_crit_named(pc_list, 2,
- Top(names), ~0, *(getCurRoom()),
+ names.peekFront(),
+ ~0, *(getCurRoom()),
TRUE);
was_link_dead = FALSE;
}//if
Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/misc.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -292,8 +292,8 @@
}
}
- Put(&vict, agg.IS_FIGHTING);
- Put(&agg, vict.IS_FIGHTING);
+ agg.IS_FIGHTING.append(&vict);
+ vict.IS_FIGHTING.append(&agg);
//Some mobs will remember....
if (vict.isNpc()) {
@@ -701,7 +701,7 @@
if ((obj_count(tmp_mob.inv, *obj_ptr) >
obj_count(mob_list[k].inv, *obj_ptr))
&& (obj_ptr->getCurInGame() < obj_ptr->getMaxInGame())) {
- Put (&obj_list[obj_ptr->getIdNum()], mob_list[k].inv);
+ mob_list[k].inv.append(&obj_list[obj_ptr->getIdNum()]);
recursive_init_loads(obj_list[obj_ptr->getIdNum()], 0);
}
}
@@ -781,7 +781,7 @@
if ((obj_count(tmp_mob.inv, *obj_ptr) >
obj_count(mob_list[k].inv, *obj_ptr))
&& (obj_ptr->getCurInGame() < obj_ptr->getMaxInGame())) {
- Put(&(obj_list[obj_ptr->getIdNum()]), mob_list[k].inv);
+ mob_list[k].inv.append(&(obj_list[obj_ptr->getIdNum()]));
recursive_init_loads(obj_list[obj_ptr->getIdNum()], 0);
}//if
}//while
@@ -847,7 +847,7 @@
if ((obj_count(temp_obj.inv, *obj_ptr) >
obj_count(obj_list[k].inv, *obj_ptr)) &&
(obj_ptr->getCurInGame() < obj_ptr->getMaxInGame())) {
- Put(&(obj_list[obj_ptr->getIdNum()]), obj_list[k].inv);
+ obj_list[k].inv.append(&(obj_list[obj_ptr->getIdNum()]));
recursive_init_loads(obj_list[obj_ptr->getIdNum()], 0);
}
}
@@ -914,7 +914,7 @@
if ((obj_count(temp_obj.inv, *obj_ptr) >
obj_count(obj_list[k].inv, *obj_ptr))
&& (obj_ptr->getCurInGame() < obj_ptr->getMaxInGame())) {
- Put(&(obj_list[obj_ptr->getIdNum()]), obj_list[k].inv);
+ obj_list[k].inv.append(&(obj_list[obj_ptr->getIdNum()]));
recursive_init_loads(obj_list[obj_ptr->getIdNum()], 0);
}//if
}//while
@@ -1440,7 +1440,7 @@
crit_ptr = crit_cell.next();
while (crit_ptr) {
- if (!IsEmpty(crit_ptr->affected_by)) {
+ if (!crit_ptr->affected_by.isEmpty()) {
crit_ptr->affected_by.head(sp_cell);
sp_ptr = sp_cell.next();
while (sp_ptr) {
@@ -1780,7 +1780,7 @@
spcell->stat_spell = spell;
spcell->bonus_duration = duration;
- Put(spcell, vict.affected_by);
+ vict.affected_by.append(spcell);
}//gain spell_affected_by
@@ -1791,7 +1791,7 @@
spcell->stat_spell = spell;
spcell->bonus_duration = duration;
- Put(spcell, vict.affected_by);
+ vict.affected_by.append(spcell);
}//gain spell_affected_by
@@ -1925,7 +1925,7 @@
// log("In out_str.\n");
if (pc.pc) {
- if (IsEmpty(lst)) {
+ if (lst.isEmpty()) {
pc.show("You see nothing special.\n");
return;
}//if
@@ -2220,7 +2220,7 @@
pc.show("<ITEM_LIST>");
}
- if (IsEmpty(lst) && type_of_list == OBJ_INV) {
+ if (lst.isEmpty() && type_of_list == OBJ_INV) {
pc.show(" [empty] \n");
if (pc.isUsingClient()) {
pc.show("</ITEM_LIST>");
@@ -2333,8 +2333,8 @@
}//if
if (pc.canDetectMagic() &&
- (!IsEmpty(obj_ptr->affected_by) ||
- !IsEmpty(obj_ptr->stat_affects))) {
+ (!obj_ptr->affected_by.isEmpty() ||
+ !obj_ptr->stat_affects.isEmpty())) {
buf.Append("^B{Blue Glow}^0\n");
}//if
else {
@@ -2416,8 +2416,8 @@
}//if
if (pc.canDetectMagic() &&
- (!IsEmpty(obj_ptr->affected_by) ||
- !IsEmpty(obj_ptr->stat_affects))) {
+ (!obj_ptr->affected_by.isEmpty() ||
+ !obj_ptr->stat_affects.isEmpty())) {
buf.Append("^B{Blue Glow}^0\n");
@@ -2725,7 +2725,7 @@
return &SOMETHING;
}//if
else {
- String* tmp = Top(obj.names);
+ String* tmp = obj.names.peekFront();
if (tmp)
return tmp;
else
@@ -2745,11 +2745,11 @@
}//long name_of_obj
String* name_of_room(const room& rm, int see_bit) {
- if ((IsEmpty(rm.names)) || !detect(see_bit, rm.getVisBit())) {
+ if ((rm.names.isEmpty()) || !detect(see_bit, rm.getVisBit())) {
return &SOMEWHERE;
}//if
else {
- return Top(rm.names);
+ return rm.names.peekFront();
}//else
}//name_of_room
@@ -2767,7 +2767,7 @@
return &SOMETHING;
}//if
- if (IsEmpty(dr.names))
+ if (dr.names.isEmpty())
return &UNKNOWN;
if (dest >= 0) {
Modified: trunk/mud/grrmud/server/misc2.cc
===================================================================
--- trunk/mud/grrmud/server/misc2.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/misc2.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -817,7 +817,7 @@
const String* single_obj_name(object& obj, int see_bit) {
if (detect(see_bit, obj.OBJ_VIS_BIT))
- return Top(obj.names);
+ return obj.names.peekFront();
else
return &SOMETHING; //global 'someone' String
}//single_obj_name
@@ -2169,7 +2169,7 @@
critter* get_target_mob(int i_th, const String* target, critter& pc, char* diversions){
critter* vict = NULL;
if (target->Strlen() == 0)
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
else
vict = ROOM.haveCritNamed(i_th, target, pc);
// if (!vict) doFailureNoTarget();
Modified: trunk/mud/grrmud/server/olc.cc
===================================================================
--- trunk/mud/grrmud/server/olc.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/olc.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -243,12 +243,12 @@
}//if
else {
if (string == "~") {
- if (!IsEmpty((OLC_OBJ->names)))
+ if (!OLC_OBJ->names.isEmpty())
O_COUNT = 3;
}//if
else {
tmp_str = new String(string);
- Put(tmp_str, (OLC_OBJ->names));
+ OLC_OBJ->names.append(tmp_str);
}//else
}//else
}//while
@@ -645,7 +645,7 @@
}//else
}//if
else {
- sp_ptr = Top(OLC_OBJ->affected_by);
+ sp_ptr = OLC_OBJ->affected_by.peekFront();
sp_ptr->bonus_duration = i;
j = TRUE; //once again looking for first..
}//if
@@ -724,7 +724,7 @@
}//else
}//if
else {
- sp_ptr = Top(OLC_OBJ->stat_affects);
+ sp_ptr = OLC_OBJ->stat_affects.peekFront();
sp_ptr->bonus_duration = i;
j = TRUE; //once again looking for first..
}//if
@@ -844,12 +844,12 @@
}//if
else {
if (string == "~") {
- if (!IsEmpty(OLC_MOB->names))
+ if (!OLC_MOB->names.isEmpty())
O_COUNT = 17;
}//if
else {
tmp_str = new String(string);
- Put(tmp_str, OLC_MOB->names);
+ OLC_MOB->names.append(tmp_str);
}//else
}//else
}//while
@@ -1233,7 +1233,7 @@
}//else
}//if
else {
- sp_ptr = Top(OLC_MOB->affected_by);
+ sp_ptr = OLC_MOB->affected_by.peekFront();
sp_ptr->bonus_duration = i;
j = TRUE; //once again looking for first..
}//if
@@ -1869,12 +1869,12 @@
}//if
else {
if (string == "~") {
- if (!IsEmpty(OLC_ROOM->names))
+ if (!OLC_ROOM->names.isEmpty())
O_COUNT = 40;
}//if
else {
tmp_str = new String(string);
- Put(tmp_str, OLC_ROOM->names);
+ OLC_ROOM->names.append(tmp_str);
}//else
}//else
}//while
@@ -2038,7 +2038,7 @@
}//else
}//if
else {
- sp_ptr = Top(OLC_ROOM->affected_by);
+ sp_ptr = OLC_ROOM->affected_by.peekFront();
sp_ptr->bonus_duration = i;
j = TRUE; //once again looking for first..
}//if
@@ -2196,12 +2196,12 @@
}//if
else {
if (string == "~") {
- if (!IsEmpty(OLC_DOOR->names))
+ if (!OLC_DOOR->names.isEmpty())
O_COUNT = 49;
}//if
else {
tmp_str = new String(string);
- Put(tmp_str, OLC_DOOR->names);
+ OLC_DOOR->names.append(tmp_str);
}//else
}//else
}//while
@@ -2539,7 +2539,7 @@
}//if
else {
OLC_MOB->TOPICS.prepend(new say_proc_cell); //add a new one
- (Top(OLC_MOB->TOPICS))->topic = string;
+ (OLC_MOB->TOPICS.peekFront())->topic = string;
O_COUNT = 59; //go get topic message
}//else
break;
@@ -2613,8 +2613,8 @@
break;
}//if
else {
- (Top(OLC_MOB->TOPICS))->msg += string;
- (Top(OLC_MOB->TOPICS))->msg += "\n";
+ (OLC_MOB->TOPICS.peekFront())->msg += string;
+ (OLC_MOB->TOPICS.peekFront())->msg += "\n";
}//else
}//while TRUE
break;
@@ -2690,7 +2690,7 @@
break;
}//if
else {
- (Top(OLC_MOB->TOPICS))->skill_name = string;
+ (OLC_MOB->TOPICS.peekFront())->skill_name = string;
O_COUNT = 67; //obj to give to pc
}//else
break;
@@ -2766,7 +2766,7 @@
i = atoi(string);
if (!check_l_range(i, 0, NUMBER_OF_ITEMS, pc, TRUE))
break;
- (Top(OLC_MOB->TOPICS))->obj_num = i;
+ (OLC_MOB->TOPICS.peekFront())->obj_num = i;
O_COUNT = 71; //go get trans to room
}//if
else {
@@ -2854,7 +2854,7 @@
i = atoi(string);
if (!check_l_range(i, 0, NUMBER_OF_ROOMS, pc, TRUE))
break;
- (Top(OLC_MOB->TOPICS))->trans_to_room = i;
+ (OLC_MOB->TOPICS.peekFront())->trans_to_room = i;
O_COUNT = 73; //go see if should do another
}//if
else {
@@ -3081,7 +3081,7 @@
}//else
}//if
else {
- sp_ptr = Top(OLC_OBJ->CASTS_THESE_SPELLS);
+ sp_ptr = OLC_OBJ->CASTS_THESE_SPELLS.peekFront();
sp_ptr->stat_spell = i;
j = TRUE; //once again looking for first..
}//if
@@ -3385,7 +3385,7 @@
system(tdir);
ofile_buf += "/";
- ofile_buf += *(Top(OLC_MOB->names));
+ ofile_buf += *(OLC_MOB->names.peekFront());
ofile_buf.Append(OLC_MOB->MOB_NUM);
ofstream ofile(ofile_buf);
if (!ofile) {
Modified: trunk/mud/grrmud/server/olc2.cc
===================================================================
--- trunk/mud/grrmud/server/olc2.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/olc2.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -832,7 +832,7 @@
}//if
if (mob_list[mnum].mob && mob_list[mnum].mob->proc_data &&
- !IsEmpty(mob_list[mnum].mob->proc_data->topics)) {
+ !mob_list[mnum].mob->proc_data->topics.isEmpty()) {
mob_list[mnum].mob->proc_data->topics.clearAndDestroy();
mob_list[mnum].mob->proc_data->flag1.turn_off(6);
show("Disscuss procs removed.\n", pc);
@@ -2256,7 +2256,7 @@
return -1;
}//if
- Put(new String(*name), mob_list[which_un].names);
+ mob_list[which_un].names.append(new String(*name));
show("Added a name to the critter.\n", pc);
return 0;
Modified: trunk/mud/grrmud/server/pet_spll.cc
===================================================================
--- trunk/mud/grrmud/server/pet_spll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/pet_spll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -222,7 +222,7 @@
golem->setHP_MAX(golem->HP);
golem->MA_MAX = golem->MANA;
/* now it follows and is a pet of the person */
- Put(golem, pc.PETS);
+ pc.PETS.append(golem);
golem->MASTER = &pc;
golem->doFollow(pc); // golem starts following caster
@@ -329,7 +329,7 @@
pc.MANA -= spell_mana;
/* now it follows and is a pet of the person */
- Put(&vict, pc.PETS);
+ pc.PETS.append(&vict);
vict.MASTER = &pc;
if (vict.mob) {
@@ -484,7 +484,7 @@
pet->ALIGN = pc.ALIGN;
/* now it follows and is a pet of the person */
- Put(pet, pc.PETS);
+ pc.PETS.append(pet);
pet->MASTER = &pc;
pet->doFollow(pc); // golem starts following caster
@@ -573,7 +573,7 @@
golem->LEVEL = pc.LEVEL;
/* now it follows and is a pet of the person */
- Put(golem, pc.PETS);
+ pc.PETS.append(golem);
golem->MASTER = &pc;
golem->doFollow(pc); // golem starts following caster
@@ -822,7 +822,7 @@
golem->RACE = pc.RACE;
golem->ALIGN = 0;
- golem->names.prepend(new String(*(Top(pc.names))));
+ golem->names.prepend(new String(*(pc.names.peekFront())));
if (pc.pc) {
Sprintf(buf, "%S %S", name_of_crit(pc, ~0), &(pc.short_desc));
golem->short_desc = buf;
@@ -919,7 +919,7 @@
if (pc.PETS.size() < (pc.CHA/4 + 1) &&
(d(1, pc.CHA * 10 + lvl * 4) > (d(1, golem->LEVEL * 4)))) {
/* now it follows and is a pet of the person */
- Put(golem, pc.PETS);
+ pc.PETS.append(golem);
golem->MASTER = &pc;
golem->doFollow(pc); // golem starts following caster
}//if it worked
@@ -1026,7 +1026,7 @@
if (pc.PETS.size() < (pc.CHA/4 + 1) &&
(d(1, pc.CHA * 10 + lvl * 4) > (d(1, golem->LEVEL * 2)))) {
/* now it follows and is a pet of the person */
- Put(golem, pc.PETS);
+ pc.PETS.append(golem);
golem->MASTER = &pc;
golem->doFollow(pc); // golem starts following caster
}//if it worked
Modified: trunk/mud/grrmud/server/rm_spll.cc
===================================================================
--- trunk/mud/grrmud/server/rm_spll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/rm_spll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -282,7 +282,7 @@
sp->bonus_duration += (int)((float)(lvl) / 4.0);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/3), dptr->affected_by);
+ dptr->affected_by.append(new stat_spell_cell(spell_num, lvl/3));
affected_doors.gainData(dptr); //add to global aff'd list
}
@@ -291,7 +291,7 @@
sp->bonus_duration += (int)((float)(lvl) / 4.0);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/3), dr.affected_by);
+ dr.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
affected_doors.gainData(&dr); //add to global aff'd list
}
}//if
@@ -378,8 +378,7 @@
sp->bonus_duration += (int)((float)(lvl) / 4.0);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/3),
- d_ptr->affected_by);
+ d_ptr->affected_by.append(new stat_spell_cell(spell_num, lvl/3));
affected_doors.gainData(d_ptr); //add to global aff'd list
}//if
}//while
@@ -397,8 +396,7 @@
sp->bonus_duration += (int)((float)(lvl) / 4.0);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/3),
- d_ptr->affected_by);
+ d_ptr->affected_by.append(new stat_spell_cell(spell_num, lvl/3));
affected_doors.gainData(d_ptr); //add to global aff'd list
}//if
}//while
Modified: trunk/mud/grrmud/server/room.cc
===================================================================
--- trunk/mud/grrmud/server/room.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/room.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -316,7 +316,7 @@
Clear(); //clear this thing out!!
while ((string = cll.next())) {
- Put(new String(*(string)), names);
+ names.append(new String(*(string)));
}//while
short_desc = source.short_desc;
@@ -506,7 +506,7 @@
return;
} // if
while ((row=mysql_fetch_row(result))) {
- Put(new String(row[0]), names);
+ names.append(new String(row[0]));
} // while
mysql_free_result(result);
} // if
@@ -619,7 +619,7 @@
return;
} // if
while ((tmp_row=mysql_fetch_row(result))) {
- Put(new stat_spell_cell(atoi(row[0]), atoi(row[1])), dr_ptr->affected_by);
+ dr_ptr->affected_by.append(new stat_spell_cell(atoi(row[0]), atoi(row[1])));
} // while
} // if
else {
@@ -766,7 +766,7 @@
ss_ptr = new stat_spell_cell;
ss_ptr->stat_spell = atoi(row[0]);
ss_ptr->bonus_duration = atoi(row[1]);
- Put(ss_ptr, affected_by);
+ affected_by.append(ss_ptr);
} // while
mysql_free_result(result);
} // if
@@ -870,7 +870,7 @@
}//if
else {
string = new String(tmp_str);
- Put(string, names);
+ names.append(string);
}//else
}//while
ofile.getline(tmp, 80);
@@ -928,7 +928,7 @@
ss_ptr = new stat_spell_cell;
ss_ptr->stat_spell = i;
ofile >> ss_ptr->bonus_duration;
- Put(ss_ptr, affected_by);
+ affected_by.append(ss_ptr);
ofile >> i;
}//while
@@ -1090,7 +1090,7 @@
ptr = new RoomScript();
ptr->read(ofile);
- Put(ptr, room_proc_scripts);
+ room_proc_scripts.append(ptr);
ofile >> sent_;
ofile.getline(tmp, 80);
if (mudlog.ofLevel(DB))
Modified: trunk/mud/grrmud/server/skills.cc
===================================================================
--- trunk/mud/grrmud/server/skills.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/skills.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -366,7 +366,7 @@
String buf(100);
if (!victim->Strlen()) {
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
if (crit_ptr && !detect(pc.SEE_BIT, crit_ptr->VIS_BIT))
crit_ptr = NULL;
}//if
@@ -480,7 +480,7 @@
String buf(100);
if (!victim->Strlen()) {
- if (!(crit_ptr = Top(pc.IS_FIGHTING))) {
+ if (!(crit_ptr = pc.IS_FIGHTING.peekFront())) {
show("Bash who?\n", pc);
return -1;
}//if
@@ -652,7 +652,7 @@
String buf(100);
if (!victim->Strlen()) {
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
if (crit_ptr && !detect(pc.SEE_BIT, crit_ptr->VIS_BIT))
crit_ptr = NULL;
}//if
@@ -689,7 +689,7 @@
return -1;
}//if
- if (!HaveData(&vict, pc.IS_FIGHTING)) {
+ if (! pc.IS_FIGHTING.haveData(&vict) ) {
return -1;
}//if
@@ -770,7 +770,7 @@
}//if
if (!victim->Strlen()) {
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
if (crit_ptr && !detect(pc.SEE_BIT, crit_ptr->VIS_BIT))
crit_ptr = NULL;
}//if
@@ -818,7 +818,7 @@
return -1;
}//if
- if (!HaveData(&vict, pc.IS_FIGHTING)) {
+ if (! pc.IS_FIGHTING.haveData(&vict) ) {
join_in_battle(pc, vict);
}//if
@@ -893,8 +893,7 @@
ptr->bonus_duration += 2;//doesn't increase much after
//the first hit
} else {
- Put(new stat_spell_cell(BLINDNESS_SKILL_NUM, pc.LEVEL/10 + 1),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(BLINDNESS_SKILL_NUM, pc.LEVEL/10 + 1));
vict.SEE_BIT &= ~(1024); //turn off the flag
}
@@ -980,7 +979,7 @@
}//if
}//while
- ptr = Top(toolbox->inv);
+ ptr = toolbox->inv.peekFront();
if (!ptr->obj_proc) {
Sprintf(buf, "ERROR: %S is COMPONENT w/NULL obj_proc.\n",
@@ -1159,7 +1158,7 @@
return -1;
}//if
- if (IsEmpty(cauldron->inv)) {
+ if (cauldron->inv.isEmpty()) {
show("You need ingredients in your cauldron to brew with!\n",
pc);
return -1;
@@ -1188,7 +1187,7 @@
}//if
}//while
- ptr = Top(cauldron->inv);
+ ptr = cauldron->inv.peekFront();
if (!ptr->obj_proc) {
Sprintf(buf, "ERROR: %S is COMPONENT w/NULL obj_proc.\n",
Modified: trunk/mud/grrmud/server/socials.cc
===================================================================
--- trunk/mud/grrmud/server/socials.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/socials.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -2034,7 +2034,7 @@
else if (pc.POS > POS_SIT)
show(NOT_IN_POSN, pc);
else if (crit_ptr == &pc) {
- if (strcasecmp(*(Top(pc.names)), "levander") == 0) {
+ if (strcasecmp(*(pc.names.peekFront()), "levander") == 0) {
show("You ARE a Ponder!!.\n", pc);
}//if
else {
Modified: trunk/mud/grrmud/server/spec_prc.cc
===================================================================
--- trunk/mud/grrmud/server/spec_prc.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/spec_prc.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -177,7 +177,7 @@
return -1;
if (targ.mob && targ.mob->proc_data &&
- !IsEmpty(targ.mob->proc_data->topics)) { //if so, got a live one!
+ !targ.mob->proc_data->topics.isEmpty()) { //if so, got a live one!
if (!pass_domob_checks(targ, pc))
return -1;
@@ -386,7 +386,7 @@
else if (bad_ass < 3) {
flee_to_safety(targ, is_targ_dead);
if (!is_targ_dead)
- hit(1, Top(pc.names), targ); //in case they fled to room of agg
+ hit(1, pc.names.peekFront(), targ); //in case they fled to room of agg
}//else no ranged attack
else {
prone(targ);
@@ -874,7 +874,7 @@
return -1;
}//if
- Sprintf(gtobj, "get %S\n", Top(obj_ptr->names));
+ Sprintf(gtobj, "get %S\n", obj_ptr->names.peekFront());
ptr->processInput(gtobj, FALSE, TRUE);
if (!ptr->isAnimal() && !ptr->isMonster()) {
@@ -1222,7 +1222,7 @@
if (price > pc.GOLD) {
do_tell(keeper, "I don't run a charity here!!", pc, FALSE,
pc.getCurRoomNum());
- disdain(1, Top(pc.names), keeper, ROOM);
+ disdain(1, pc.names.peekFront(), keeper, ROOM);
return -1;
}//if
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/spells.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -801,7 +801,7 @@
}//else lost concentration
}//else !canned
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
@@ -819,7 +819,7 @@
int spell_num = FIREBALL_SKILL_NUM;
if (victim->Strlen() == 0)
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
else
vict = ROOM.haveCritNamed(i_th, victim, pc);
if (!vict) {
@@ -1375,7 +1375,7 @@
int spell_num = POISON_SKILL_NUM;
if (victim->Strlen() == 0)
- vict = Top(pc.IS_FIGHTING);
+ vict = pc.IS_FIGHTING.peekFront();
else
vict = ROOM.haveCritNamed(i_th, victim, pc);
if (!vict) {
@@ -1502,13 +1502,13 @@
}//if
}//while
- Put(new stat_spell_cell(spell_num, lvl/3), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/3));
vict.HP_REGEN += POISON_HP_REGEN_AUGMENTATION;
vict.MV_REGEN += POISON_MV_REGEN_AUGMENTATION;
vict.MA_REGEN += POISON_MA_REGEN_AUGMENTATION;
}//if
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING)) {
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict)) {
join_in_battle(agg, vict);
}//if
}//do_cast_poison
@@ -1578,7 +1578,7 @@
affected_rooms.gainData(&rm); //add to global affected list so
//spell can wear off eventually
- Put(new stat_spell_cell(spell_num, lvl/2), rm.affected_by);
+ rm.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
rm.setVisBit(rm.getVisBit() & ~1); //make it light
}//if
}//do_cast_illuminate
Modified: trunk/mud/grrmud/server/spells2.cc
===================================================================
--- trunk/mud/grrmud/server/spells2.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/spells2.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -368,8 +368,7 @@
ptr->bonus_duration += lvl/2;
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.HP_REGEN += BIND_WOUND_EFFECT;
if (&vict == &agg) {
@@ -454,8 +453,7 @@
ptr->bonus_duration += lvl/2;
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.AC += SHADOWS_BLESSING_EFFECT;
if (&vict == &agg) {
@@ -707,8 +705,7 @@
show("Ok.\n", agg);
}//if
else if (vict.LEVEL > agg.LEVEL) {
- Put(new stat_spell_cell(STONE_SKIN_SKILL_NUM, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(STONE_SKIN_SKILL_NUM, lvl + 5));
vict.DAM_REC_MOD += STONE_SKIN_EFFECT_DRM;
vict.DEX += STONE_SKIN_EFFECT_DEX;
@@ -729,8 +726,7 @@
}//else
} // else if (vict.LEVEL > agg.LEVEL)
else {
- Put(new stat_spell_cell(spell_num, lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.CRIT_FLAGS.turn_on(14);
if (&vict == &agg) {
@@ -772,7 +768,7 @@
}//else lost concentration
agg.PAUSE += 1;
- if (do_join_in_battle && !HaveData(&vict, agg.IS_FIGHTING ))
+ if (do_join_in_battle && !agg.IS_FIGHTING.haveData(&vict))
join_in_battle(agg, vict);
}
@@ -826,8 +822,7 @@
show("They are already asleep!\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/6 + 1),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/6 + 1));
vict.CRIT_FLAGS.turn_on(15); //is perm_sleeped
vict.setPosn(POS_SLEEP);
@@ -944,8 +939,7 @@
} // already duration > 40 and !canned
} //if ptr
else {
- Put(new stat_spell_cell(spell_num, lvl),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.STR += STRENGTH_EFFECT;
if (&vict == &agg) {
@@ -1220,8 +1214,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/2 + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2 + 5));
vict.STR += CURSE_STR_EFFECT;
vict.MA_REGEN += CURSE_MA_REGEN_EFFECT;
@@ -1287,8 +1280,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/2 + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2 + 5));
vict.OBJ_FLAGS.turn_on(5); //no_drop
Sprintf(buf, "You lay a curse on %S!\n",
@@ -1336,8 +1328,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/2),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.SEE_BIT &= ~(1024); //turn off the flag
if (&vict == &agg) {
@@ -1430,7 +1421,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/2), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
vict.STR += WEAKEN_EFFECT;
if (vict.pc) {
@@ -1541,8 +1532,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/2 + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2 + 5));
vict.CRIT_FLAGS.turn_on(3);
if (&vict == &agg) {
@@ -1635,8 +1625,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl/4 + 4),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl/4 + 4));
vict.ATTACKS++;
if (&vict == &agg) {
@@ -1887,8 +1876,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.HEAT_RESIS += FIRE_PROOF_EFFECT;
if (&vict == &agg) {
@@ -1968,8 +1956,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.AC += MAGIC_SHIELD_AC_EFFECT;
vict.SPEL_RESIS += MAGIC_SHIELD_SAC_EFFECT;
@@ -2056,8 +2043,7 @@
agg.show("Sanctuary cannot be used with Stone skin.\n");
}
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.DAM_REC_MOD += SANCTUARY_EFFECT_DRM;
if (&vict == &agg) {
@@ -2136,8 +2122,7 @@
show("You strengthen the globe.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.AC += PRISMATIC_GLOBE_EFFECT_AC;
vict.MOV += PRISMATIC_GLOBE_EFFECT_MOV;
@@ -2224,8 +2209,7 @@
agg.show("Stone skin cannot be used with Sanctuary.\n");
}
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.DAM_REC_MOD += STONE_SKIN_EFFECT_DRM;
vict.DEX += STONE_SKIN_EFFECT_DEX;
@@ -2309,8 +2293,7 @@
agg); //can't be affected by both at once
}//if divine_protection already
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.AC += ARMOR_EFFECT;
vict.SPEL_RESIS += ARMOR_EFFECT_M;
@@ -2394,8 +2377,7 @@
show("Ok.\n", agg);
}//if
else {
- Put(new stat_spell_cell(spell_num, lvl),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
if (&vict == &agg) {
show(
@@ -2468,8 +2450,7 @@
show("Ok.\n", agg); //can't be affected by both at once
}//if armored already
else {
- Put(new stat_spell_cell(spell_num, lvl + 5),
- vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl + 5));
vict.AC += DIVINE_PROTECTION_EFFECT;
if (&vict == &agg) {
@@ -2537,7 +2518,7 @@
return;
}//if
- if (!IsEmpty(obj.inv)) {
+ if (!obj.inv.isEmpty()) {
Cell<object*> cll(obj.inv);
object* ptr;
while ((ptr = cll.next())) {
@@ -2577,7 +2558,7 @@
return;
}//if
- if (!IsEmpty(crit.inv)) {
+ if (!crit.inv.isEmpty()) {
Cell<object*> cll(crit.inv);
object* ptr;
while ((ptr = cll.next())) {
@@ -2703,7 +2684,7 @@
if ( ptr ) {
ptr->bonus_duration += lvl / 2;
} else {
- Put(new stat_spell_cell(spell_num, lvl), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.AC += RUST_EFFECT;
// Cast on self
@@ -2778,7 +2759,7 @@
if ( ptr ) {
ptr->bonus_duration += lvl / 2;
} else {
- Put(new stat_spell_cell(spell_num, lvl), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.HEAT_RESIS += DISFAVOR_EFFECT;
vict.COLD_RESIS += DISFAVOR_EFFECT;
vict.ELEC_RESIS += DISFAVOR_EFFECT;
@@ -2858,7 +2839,7 @@
if ( ptr ) {
ptr->bonus_duration += lvl / 2;
} else {
- Put(new stat_spell_cell(spell_num, lvl), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.SPEL_RESIS += REMOVE_SOUL_EFFECT;
// Cast on self
@@ -2939,7 +2920,7 @@
agg.show("You can do no more.", HL_DEF);
} else {
// Hardcoded in this lasts for 4 ticks.
- Put(new stat_spell_cell(spell_num, 4), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, 4));
// Cast on self
if ( &vict == &agg ) {
@@ -3011,7 +2992,7 @@
agg.show("You can do no more.", HL_DEF);
} else {
// Hardcoded in this lasts for 4 ticks.
- Put(new stat_spell_cell(spell_num, 4), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, 4));
// Cast on self
if ( &vict == &agg ) {
@@ -3079,7 +3060,7 @@
if ( ptr ) {
ptr->bonus_duration += 1;
} else {
- Put(new stat_spell_cell(spell_num, lvl), vict.affected_by);
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
vict.DAM_REC_MOD += SANCTUM_EFFECT;
// Cast on self
Modified: trunk/mud/grrmud/server/tmp_socials.cc
===================================================================
--- trunk/mud/grrmud/server/tmp_socials.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/tmp_socials.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -1060,7 +1060,7 @@
else if (pc.POS > POS_SIT)
show("You are not in a position to do that.\n", pc);
else if (crit_ptr == &pc) {
- if (strcasecmp(*(Top(pc.names)), "levander") == 0) {
+ if (strcasecmp(*(pc.names.peekFront()), "levander") == 0) {
show("You ARE a Ponder!!.\n", pc);
}//if
else {
Modified: trunk/mud/grrmud/server/trv_spll.cc
===================================================================
--- trunk/mud/grrmud/server/trv_spll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/trv_spll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -175,7 +175,7 @@
Sprintf(buf, "is burned by %S's pillar of fire!",
name_of_crit(agg, ~0));
emote(buf, *ptr, room_list[agg.getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
@@ -263,7 +263,7 @@
Sprintf(buf, "is struck by %S's meteor!",
name_of_crit(agg, ~0));
emote(buf, *ptr, room_list[agg.getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
@@ -351,7 +351,7 @@
Sprintf(buf, "is struck by %S's ice shard!",
name_of_crit(agg, ~0));
emote(buf, *ptr, room_list[agg.getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
@@ -438,7 +438,7 @@
Sprintf(buf, "is burned by %S's fire storm!",
name_of_crit(agg, ~0));
emote(buf, *ptr, room_list[agg.getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
@@ -507,7 +507,7 @@
show("You are fried by the bolt of lightning!\n", *ptr);
emote("is struck by the lightning bolt.", *ptr,
room_list[ptr->getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
@@ -586,7 +586,7 @@
show("You are injured by the earthquake!\n", *ptr);
emote("is injured by the earthquake.", *ptr,
room_list[ptr->getCurRoomNum()], TRUE);
- if (!HaveData(&agg, ptr->IS_FIGHTING)) {
+ if (!ptr->IS_FIGHTING.haveData(&agg)) {
join_in_battle(*ptr, agg);
}//if
}//else
Modified: trunk/mud/grrmud/server/vehicle.cc
===================================================================
--- trunk/mud/grrmud/server/vehicle.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/vehicle.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -592,7 +592,7 @@
while ((sentinel != -1) && da_file) {
ptr = new PathCell();
ptr->Read(da_file);
- Put(ptr, path_cells);
+ path_cells.append(ptr);
da_file >> sentinel;
da_file.getline(tmp, 80);
Modified: trunk/mud/grrmud/server/wep_skll.cc
===================================================================
--- trunk/mud/grrmud/server/wep_skll.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/wep_skll.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -42,7 +42,7 @@
String buf(100);
if (victim->Strlen() == 0)
- crit_ptr = Top(pc.IS_FIGHTING);
+ crit_ptr = pc.IS_FIGHTING.peekFront();
else
crit_ptr = ROOM.haveCritNamed(i_th, victim, pc.SEE_BIT);
@@ -52,7 +52,7 @@
return -1;
}
- if (!HaveData(crit_ptr, pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.haveData(crit_ptr)) {
show("You must be fighting a person to circle him.\n", pc);
return -1;
}//if
@@ -209,7 +209,7 @@
if (!(crit_ptr = check_for_diversions(*crit_ptr, "GM", pc)))
return -1;
- if (!IsEmpty(crit_ptr->IS_FIGHTING)) {
+ if (!crit_ptr->IS_FIGHTING.isEmpty()) {
show("The element of supprise has been lost.\n", pc);
return do_hit(*crit_ptr, pc);
}//if
@@ -234,7 +234,7 @@
return -1;
}//if
- if (!HaveData(&vict, pc.IS_FIGHTING)) {
+ if (!pc.IS_FIGHTING.haveData(&vict)) {
join_in_battle(pc, vict);
}//if
Modified: trunk/mud/grrmud/server/zone.cc
===================================================================
--- trunk/mud/grrmud/server/zone.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/grrmud/server/zone.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -771,7 +771,7 @@
/* if the current z-layer is depleted, push the vertical rooms that
* we've been queuing onto our tree
*/
- if ( (!par) && (!IsEmpty(vertical_rooms)) ) {
+ if ( (!par) && (!vertical_rooms.isEmpty()) ) {
vertical_rooms.head(vr_cll);
while ( (tmp = vr_cll.next()) ) {
par2.Push_Child(tmp);
@@ -950,7 +950,7 @@
String* ptr;
while ((ptr = cll.next())) {
- if (strcasecmp(*ptr, *(Top(pc.names))) == 0)
+ if (strcasecmp(*ptr, *(pc.names.peekFront())) == 0)
return TRUE;
}//wile
}//if
Modified: trunk/mud/lib/containers/PtrArray.cc
===================================================================
--- trunk/mud/lib/containers/PtrArray.cc 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/lib/containers/PtrArray.cc 2006-06-22 01:46:37 UTC (rev 830)
@@ -1,12 +1,11 @@
// $Id$
-// $Revision: 1.5 $ $Author$ $Date$
+// $Revision$ $Author$ $Date$
//
-//ScryMUD Server Code
-//Copyright (C) 1998 Ben Greear
+//Copyright (C) 2001 Ben Greear
//
//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU General Public License
+//modify it under the terms of the GNU Library General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//
@@ -15,12 +14,11 @@
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
-//You should have received a copy of the GNU General Public License
+//You should have received a copy of the GNU Library General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
-// To contact the Author, Ben Greear: greear at cyberhighway.net, (preferred)
-// greearb at agcs.com
+// To contact the Author, Ben Greear: greearb at candelatech.com
//
// PtrArrayBase, PtrArray, LazyPtrArray
@@ -364,10 +362,10 @@
template <class T>
T* LazyPtrArray<T>::elementAtNoCreate(int i) {
- if ((i < 0) || (i >= max_len))
+ if ((i < 0) || (i >= PtrArrayBase<T>::max_len))
return NULL;
- return ptr_list[i];
+ return PtrArrayBase<T>::ptr_list[i];
}
@@ -378,21 +376,21 @@
// cout << "PtrArrayBase::elementAt, i: " << i << " max_len: "
// << max_len << endl;
- if ((i < 0) || (i >= max_len)) {
+ if ((i < 0) || (i >= PtrArrayBase<T>::max_len)) {
// cout << "Returning null" << endl;
return NULL;
}
//cout << "Checking for null..." << endl;
- if (ptr_list[i] == NULL) {
+ if (PtrArrayBase<T>::ptr_list[i] == NULL) {
// cout << "Creating new one..." << endl;
- ptr_list[i] = new T(i);
+ PtrArrayBase<T>::ptr_list[i] = new T(i);
}
else {
// cout << " offset wasn't null..." << endl;
}
- return ptr_list[i];
+ return PtrArrayBase<T>::ptr_list[i];
}
@@ -402,7 +400,7 @@
template <class T>
T* PtrArray<T>::operator[] (const int i) {
- return elementAt(i);
+ return PtrArrayBase<T>::elementAt(i);
}
@@ -493,7 +491,7 @@
void ObjArray<T>::purge() {
delete[] array;
array = NULL;
- butfield.off_all();
+ bf.off_all();
len = 0;
}//purge
@@ -516,21 +514,21 @@
///********************* FixedHistory *********************************///
///**********************************************************************///
+
template <class T>
-int FixedHistory<T>::init(int sz, T& null_val) {
+unsigned int FixedHistory<T>::init(unsigned int sz) {
array = new T[sz];
head = 0;
- null_value = null_val;
len = sz;
return len;
}//init
template <class T>
FixedHistory<T>::FixedHistory(const FixedHistory<T>& src) :
- len(src.len), head(src.head), null_value(src.null_value) {
- _cnt++;
+ len(src.len), head(src.head) {
+ __fixed_history_cnt++;
array = new T[len];
- for (int i = 0; i<len; i++) {
+ for (unsigned int i = 0; i<len; i++) {
array[i] = src.array[i];
}
}
@@ -539,26 +537,22 @@
FixedHistory<T>& FixedHistory<T>::operator=(const FixedHistory<T>& src) {
ensureCapacity(src.len);
len = src.len;
- for (int i = 0; i<len; i++) {
+ for (unsigned int i = 0; i<len; i++) {
array[i] = src.array[i];
}
- null_value = src.null_value;
head = src.head;
}
template <class T>
-void FixedHistory<T>::ensureCapacity(int cap) {
+void FixedHistory<T>::ensureCapacity(unsigned int cap) {
if (cap > len) {
T* tmp = array;
array = new T[cap];
- int i;
+ unsigned int i;
for (i = 0; i<len; i++) {
array[i] = tmp[i];
}//for
- for (i; i<cap; i++) {
- array[i] = null_value;
- }
delete[] tmp;
len = cap;
@@ -568,9 +562,6 @@
/** Does not clean up memory, just marks all as un-used. */
template <class T>
void FixedHistory<T>::clear() {
- for (int i = 0; i<len; i++) {
- array[i] = null_value;
- }
head = 0;
}
Modified: trunk/mud/lib/containers/PtrArray.h
===================================================================
--- trunk/mud/lib/containers/PtrArray.h 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/lib/containers/PtrArray.h 2006-06-22 01:46:37 UTC (rev 830)
@@ -1,12 +1,11 @@
// $Id$
-// $Revision: 1.6 $ $Author$ $Date$
+// $Revision$ $Author$ $Date$
//
-//ScryMUD Server Code
-//Copyright (C) 1998 Ben Greear
+//Copyright (C) 2001 Ben Greear
//
//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU General Public License
+//modify it under the terms of the GNU Library General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//
@@ -15,12 +14,11 @@
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
-//You should have received a copy of the GNU General Public License
+//You should have received a copy of the GNU Library General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
-// To contact the Author, Ben Greear: greear at cyberhighway.net, (preferred)
-// greearb at agcs.com
+// To contact the Author, Ben Greear: greearb at candelatech.com
//
// PtrArray
@@ -35,6 +33,7 @@
#include <bitfield.h>
#include <assert.h>
+#include <string2.h>
/** An array of type class T pointers. Does bounds checking
@@ -259,40 +258,39 @@
};//ObjArray
+extern int __fixed_history_cnt;
+
/** This is a fixed length queue. Meant to append and search very
* fast.
*/
template <class T> class FixedHistory {
private:
- int _cnt;
protected:
- int len;
+ unsigned int len;
unsigned int head;
T* array;
- T null_value;
- int init(int sz, T& null_val);
+ unsigned int init(unsigned int sz);
public:
- FixedHistory() { init(10, (T)(0)); }
- FixedHistory(int sz) { init(sz, (T)(0)); }
- FixedHistory(int sz, T& null_val) { init(sz, null_val); }
+ FixedHistory() { init(10); __fixed_history_cnt++; }
+ FixedHistory(int sz) { init(sz); __fixed_history_cnt++; }
FixedHistory(const FixedHistory<T>& src);
FixedHistory<T>& operator=(const FixedHistory<T>& src);
- virtual ~FixedHistory() { delete[] array; }
+ virtual ~FixedHistory() { delete[] array; __fixed_history_cnt--; }
T& elementAt(int idx) const {
- assert((idx >= 0) && (idx < len));
+ assert((idx >= 0) && ((unsigned int)(idx) < len));
return array[idx];
}
void setElementAt(int idx, T& val) {
- assert((idx >= 0) && (idx < len));
+ assert((idx >= 0) && ((unsigned int)(idx) < len));
array[idx] = val;
}
- void ensureCapacity(int sz);
+ void ensureCapacity(unsigned int sz);
int getNextIdx(int from_idx) const { return (head + 1) % len; }
int getCurIdx() { return (head % len); }
@@ -311,20 +309,21 @@
void purge();
/** Get the maximum capacity available w/out grabbing more memory. */
- int getCapacity() const { return len; }
+ unsigned int getCapacity() const { return len; }
/** Returns TRUE if the array contains the element 'val', as
- * determined by operator=
+ * determined by operator==
*/
int contains(T& val) const {
- return (indexOf(val) > 0);
+ return (indexOf(val) >= 0);
}
/** Returns < 0 if not found, first idx otherwise. As determined by
* operator=
*/
int indexOf(T& val) const {
- for (int i = 0; i<len; i++) {
+ int mx = min(len, head);
+ for (int i = 0; i<mx; i++) {
if (val == array[i]) {
return i;
}
@@ -336,13 +335,26 @@
*/
int objCount(T& val) const {
int retval = 0;
- for (int i = 0; i<len; i++) {
+ int mx = min(len, head);
+ for (int i = 0; i<mx; i++) {
if (val == array[i]) {
retval++;
}
}//for
return retval;
}//objCount
+
+
+ String toString() {
+ String retval(200);
+ Sprintf(retval, "len: %i head: %i head_idx: %i\n", len, (int)(head), (int)(head % len));
+ char tmp[50];
+ for (unsigned int i = 0; i<len; i++) {
+ sprintf(tmp, " [%i] %lu\n", i, (long unsigned int)(array[i]));
+ retval.append(tmp);
+ }//for
+ return retval;
+ }
};//FixedHistory
Modified: trunk/mud/lib/containers/list2.h
===================================================================
--- trunk/mud/lib/containers/list2.h 2005-02-14 17:15:15 UTC (rev 829)
+++ trunk/mud/lib/containers/list2.h 2006-06-22 01:46:37 UTC (rev 830)
@@ -1,12 +1,11 @@
// $Id$
-// $Revision: 1.15 $ $Author$ $Date$
+// $Revision$ $Author$ $Date$
//
-//ScryMUD Server Code
-//Copyright (C) 1998 Ben Greear
+//Copyright (C) 1998-2006 Ben Greear
//
//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU General Public License
+//modify it under the terms of the GNU Library General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//
@@ -15,12 +14,11 @@
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
-//You should have received a copy of the GNU General Public License
+//You should have received a copy of the GNU Library General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
-// To contact the Author, Ben Greear: greear at cyberhighway.net, (preferred)
-// greearb at agcs.com
+// To contact the Author, Ben Greear: greearb at candelatech.com
//
// list.h -- Declarations for the list library
@@ -37,11 +35,13 @@
#define BEN_List2_Include
#include <stdlib.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
#include <LogStream.h>
#include <string2.h>
+using namespace std;
+
#ifndef TRUE
#define TRUE 1
@@ -57,6 +57,10 @@
#define NUMBER_OF_CONCURENT_CELLS 10
+#define DBG_MEM(i)
+// #define DBG_MEM(i) i
+
+
extern LogStream mudlog;
extern int core_dump(const char* msg); //misc2.cc
extern int __node_cnt;
@@ -92,11 +96,17 @@
};//Node
virtual void handleLosingCell(Cell<T>& cll) {
- for (int i = 0; i<NUMBER_OF_CONCURENT_CELLS; i++) {
- if (cll_list[i] && (cll_list[i]->node == cll.node) &&
- (cll_list[i] != &cll)) {
- cll_list[i]->next(); //increment it through the list.
- // Assume there will always at least be the header node.
+ int mx = NUMBER_OF_CONCURENT_CELLS;
+ DBG_MEM(mudlog << "List::handleLosingCell, this: " << this << " cll: " << &cll << endl);
+
+ for (int i = 0; i<mx; i++) {
+ if (cll_list[i]) {
+ if (cll_list[i]->node == cll.node) {
+ if (cll_list[i] != &cll) {
+ cll_list[i]->next(); //increment it through the list.
+ // Assume there will always at least be the header node.
+ }
+ }
}//if
}//for
}//handleLosingCell
@@ -148,13 +158,14 @@
List(const List<T> &L) : sz(L.sz) { //copy constructor
//mudlog << "In List<T> copy constructor, (L.this: " << (void*)(&L)
// << "): " << L.toString() << "\n" << flush;
+ DBG_MEM(mudlog << "List constructor, this: " << this << endl);
__list_cnt++;
header = new Node;
memset(cll_list, 0, NUMBER_OF_CONCURENT_CELLS * sizeof(Cell<T>*));
if (!header) {
- //log("ERROR: out of Memory: List2 constructor, exiting!\n");
+ cerr << "ERROR: out of Memory: List2 constructor, exiting!\n";
exit (101);
}//if
else {
@@ -176,6 +187,7 @@
List(const T &Nil) : sz(0) {
+ DBG_MEM(mudlog << "List constructor, this: " << this << endl);
__list_cnt++;
header = new Node;
@@ -186,7 +198,7 @@
//}
if (!header) {
- //log("ERROR: out of mem, list constructor, exiting!\n");
+ cerr << "ERROR: out of mem, list constructor, exiting!\n";
exit (101);
}//if
else {
@@ -213,6 +225,8 @@
this->clear();
delete header;
+
+ DBG_MEM(mudlog << "List::destructor down, this: " << this << endl);
} //destructor
@@ -245,7 +259,7 @@
}//while
if (!header) {
- mudlog.log(ERROR, "ERROR: HEADER NULL in Clear.\n");
+ mudlog.log(1, "ERROR: HEADER NULL in Clear.\n");
}//if
sz = 0;
}// clear
@@ -270,7 +284,7 @@
Cell<T> cell(*this);
T ldata;
- Assert((int)data);
+ //Assert(data);
ldata = cell.next();
while (ldata) {
@@ -340,7 +354,7 @@
virtual void prepend(const T& data) {
Cell<T> cell(*this);
- Assert((int)data);
+ //Assert(data);
cell.insertAfter(data);
sz++;
}//push
@@ -351,7 +365,7 @@
virtual void append(const T& data) {
Cell<T> C(*this);
- Assert((int)data);
+ //Assert(data);
C.insertBefore(data);
sz++;
}//put
@@ -393,7 +407,8 @@
return ret;
}//Drag
-
+ // TODO: Optimize such that we start from the back and go foward if we are
+ // closer to the tail!
virtual int insertAt(int posn, T& val) {
Cell<T> cll(*this);
int i = 0;
@@ -482,26 +497,28 @@
}//head
virtual int assign(Cell<T>& cll, const T& data) {
- Assert(cll.isInList(this));
+ assert(cll.isInList(this));
cll.assign(data);
return TRUE;
}//Assign
virtual void insertBefore(Cell<T>& cll, const T& data) {
- Assert(cll.isInList(this));
+ assert(cll.isInList(this));
sz++;
cll.insertBefore(data);
}//insertBefore
virtual void insertAfter(Cell<T>& cll, const T& data) {
- Assert(cll.isInList(this));
+ assert(cll.isInList(this));
sz++;
cll.insertAfter(data);
- }//insertBefore
+ }//insertAfter
+ // Remove item currently pointed to by cll, and return the
+ // next one in the list.
virtual T lose(Cell<T>& cll) {
if (cll.node != header) {
- Assert(cll.isInList(this));
+ assert(cll.isInList(this));
handleLosingCell(cll);
sz--;
return cll.lose();
@@ -509,54 +526,57 @@
else {
mudlog << "ERROR: Trying to lose header, this: " << this
<< " Cell<T>: " << (void*)(&cll) << endl;
- Assert(0); //Dump core, need to debug this.
+ assert(0); //Dump core, need to debug this.
return (T)(0);
}//else
- }//insertBefore
+ }//lose.
virtual int isEmpty() const {
- Assert((int)header);
+ assert(header);
return (header->next == header);
}//IsEmpty
/* size-- Returns the number of cells contained in a List. */
virtual int size() const {
- class List<T>::Node* node_ptr = header->next;
- int count = 0;
+ //class List<T>::Node* node_ptr = header->next;
+ //int count = 0;
- while (node_ptr != header) {
- count++;
- node_ptr = node_ptr->next;
- }//while
+ //while (node_ptr != header) {
+ // count++;
+ // node_ptr = node_ptr->next;
+ //}//while
// Leave this in for a while till we're sure it's debugged!!
- if (count != sz) {
- mudlog << "ERROR: sz: " << sz << " does not match calculated size: "
- << count << endl;
- }
- return count;
+ //if (count != sz) {
+ // mudlog << "ERROR: sz: " << sz << " does not match calculated size: "
+ // << count << endl;
+ //}
+ return sz;
}//sz
+/*
virtual int Assert(const int boolean_val) const {
if (!boolean_val)
::core_dump((const char*)("List2.h"));
return TRUE;
}
+*/
-#ifdef _BG_TEMPLATE_HACK
- friend void Put<>(const T& val, List<T> &L);
+#if 0
+ void Put(const T& val, List<T> &L);
+ T Top(const List<T> &L);
+ int IsEmpty(const List<T> &L);
+ int HaveData(const T& val, const List<T>& L);
+
+ friend Put<>;
friend T Top<>(const List<T> &L);
friend int IsEmpty<>(const List<T> &L);
friend int HaveData<>(const T& val, const List<T>& L);
-#else
- friend void Put(const T& val, List<T> &L);
- friend T Top(const List<T> &L);
- friend int IsEmpty(const List<T> &L);
- friend int HaveData(const T& val, const List<T>& L);
#endif
};
+#if 0
// A few of these are back wards compatable hacks
template <class T> int HaveData(const T& val, const List<T>& L) {
@@ -575,7 +595,7 @@
template <class T> void Put(const T& val, List<T>& L) {
L.append(val);
}
-
+#endif
///************************************************************************///
///************************* Cell ***************************************///
@@ -604,10 +624,10 @@
List<T>* in_lst;
virtual void insertBefore (const T& data) {
- Assert((int)node);
- typename List<T>::Node *N = new typename List<T>::Node;
+ assert(node);
+ typename List<T>::Node *N = new typename List<T>::Node();
if (!N) {
- mudlog.log(ERROR, "ERROR, out of Memory trying to allocate a cell.\n");
+ cerr << "ERROR, out of Memory trying to allocate a cell.\n";
exit (101);
}//if
N->item = data;
@@ -618,7 +638,7 @@
}// insert before
virtual int assign(const T& data) {
- Assert(node && data);
+ assert(node && data);
node->item = data;
return TRUE;
}//Assign
@@ -626,7 +646,7 @@
/* INSTERT_AFTER-- Insert an item into a list after a given cell. */
virtual void insertAfter(const T& data) {
- Assert((int)node);
+ assert(node);
typename List<T>::Node *N = new typename List<T>::Node;
N->item = data;
N->prev = node;
@@ -659,17 +679,22 @@
// Constructors
//
- Cell () { node = NULL; __cell_cnt++; in_lst = NULL; }
+ Cell () {
+ node = NULL; __cell_cnt++; in_lst = NULL;
+ DBG_MEM(mudlog << "Cell constructor, this: " << this << endl);
+ }
Cell (const List<T>& L) : node(L.header) {
__cell_cnt++;
in_lst = (List<T>*)(&L);
in_lst->handleAddCell(*this);
+ DBG_MEM(mudlog << "Cell constructor2, this: " << this << endl);
}//constructor
virtual ~Cell() {
__cell_cnt--;
clear(); //this is important, allows the list to clean *this up.
+ DBG_MEM(mudlog << "Cell::destructor, this: " << this << endl);
}//destructor
virtual void clear() {
@@ -678,7 +703,7 @@
in_lst = NULL;
}//if
}
-
+/*
int Assert(const int boolean_val) const {
if (!boolean_val) {
::core_dump("Cell<T>");
@@ -687,6 +712,7 @@
else
return TRUE;
}//Assert
+*/
/* NEXT-- next(cell)
This function sets "cell" equal to the next cell in the list and
@@ -736,8 +762,8 @@
void clearAndDestroy() {
T* val;
- while (!isEmpty()) {
- val = popFront();
+ while (!List<T*>::isEmpty()) {
+ val = List<T*>::popFront();
delete val;
}//while
}//clearAndDestroy
More information about the ScryMUD
mailing list