--- deliantra/server/server/c_party.C 2006/12/26 08:54:59 1.11 +++ deliantra/server/server/c_party.C 2007/05/28 21:28:35 1.19 @@ -1,39 +1,31 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2002 Mark Wedel & Crossfire Development Team - Copyright (C) 1992 Frank Tore Johansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - The authors can be reached via e-mail at -*/ + * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. + * + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen + * + * Crossfire TRT is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of 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 along + * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The authors can be reached via e-mail to + */ #include #include #include -#ifdef COZY_SERVER -// used for pet monster logic etc. -int -same_party (partylist *a, partylist *b) -{ - return a == b && a; -} -#endif - static partylist *firstparty = NULL; /* Keeps track of first party in list */ static partylist *lastparty = NULL; /*Keeps track of last party in list */ @@ -72,7 +64,6 @@ partylist *tmpparty; partylist *previousparty; partylist *nextparty; - player *pl; if (firstparty == NULL) { @@ -140,7 +131,6 @@ obsolete_parties (void) { int player_count; - player *pl; partylist *party; partylist *next = NULL; @@ -158,14 +148,14 @@ } } -#ifdef PARTY_KILL_LOG void -add_kill_to_party (partylist *party, char *killer, char *dead, long exp) +add_kill_to_party (partylist *party, const char *killer, const char *dead, long exp) { int i, pos; if (party == NULL) return; + if (party->kills >= PARTY_KILL_LOG) { pos = PARTY_KILL_LOG - 1; @@ -174,6 +164,7 @@ } else pos = party->kills; + party->kills++; party->total_exp += exp; party->party_kills[pos].exp = exp; @@ -182,7 +173,6 @@ party->party_kills[pos].killer[MAX_NAME] = 0; party->party_kills[pos].dead[MAX_NAME] = 0; } -#endif int confirm_party_password (object *op) @@ -231,8 +221,6 @@ void send_party_message (object *op, char *msg) { - player *pl; - for_all_players (pl) if (pl->ob->contr->party == op->contr->party && pl->ob != op) new_draw_info (NDI_WHITE, 0, pl->ob, msg); @@ -245,13 +233,13 @@ if (!params) return 0; + strcpy (party_params, "say "); strcat (party_params, params); command_party (op, party_params); return 0; } - int command_party (object *op, char *params) { @@ -285,13 +273,10 @@ new_draw_info (NDI_UNIQUE, 0, op, "There is an 8 character max"); new_draw_info (NDI_UNIQUE, 0, op, "To talk to party members type: party say "); new_draw_info (NDI_UNIQUE, 0, op, "To see who is in your party: party who"); -#ifdef PARTY_KILL_LOG new_draw_info (NDI_UNIQUE, 0, op, "To see what you've killed, type: party kills"); -#endif return 1; } -#ifdef PARTY_KILL_LOG if (!strncmp (params, "kills", 5)) { int i, max; @@ -349,7 +334,6 @@ new_draw_info (NDI_UNIQUE, 0, op, buffer); return 1; } -#endif /* PARTY_KILL_LOG */ if (strncmp (params, "say ", 4) == 0) { @@ -369,7 +353,6 @@ if (strncmp (params, "form ", 5) == 0) { int player_count; - player *pl; params += 5; if (op->contr->party) @@ -402,14 +385,14 @@ player_count = 0; if (oldparty) { - for (pl = first_player; pl->next != NULL; pl = pl->next) - { - if (pl->party == oldparty) - player_count++; - } + for_all_players (pl) + if (pl->party == oldparty) + player_count++; + if (player_count == 0) remove_party (oldparty); } + return 0; } /* form */ @@ -430,8 +413,6 @@ if (strcmp (params, "who") == 0) { - player *pl; - tmpparty = op->contr->party; if (op->contr->party == NULL) { @@ -601,8 +582,6 @@ new_draw_info (NDI_UNIQUE, 0, op, "There is an 8 character max"); new_draw_info (NDI_UNIQUE, 0, op, "To talk to party members type: party say "); new_draw_info (NDI_UNIQUE, 0, op, "To see who is in your party: party who"); -#ifdef PARTY_KILL_LOG new_draw_info (NDI_UNIQUE, 0, op, "To see what you've killed, type: party kills"); -#endif return 1; }