ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_party.C
(Generate patch)

Comparing deliantra/server/server/c_party.C (file contents):
Revision 1.8 by root, Thu Dec 14 22:45:41 2006 UTC vs.
Revision 1.11 by root, Tue Dec 26 08:54:59 2006 UTC

20 20
21 The authors can be reached via e-mail at <crossfire@schmorp.de> 21 The authors can be reached via e-mail at <crossfire@schmorp.de>
22*/ 22*/
23 23
24#include <global.h> 24#include <global.h>
25#ifndef __CEXTRACT__
26# include <sproto.h> 25#include <sproto.h>
27#endif
28#include <spells.h> 26#include <spells.h>
29 27
30#ifdef COZY_SERVER 28#ifdef COZY_SERVER
31// used for pet monster logic etc. 29// used for pet monster logic etc.
32int 30int
80 { 78 {
81 LOG (llevError, "remove_party(): I was asked to remove party %s, but no parties are defined", target_party->partyname); 79 LOG (llevError, "remove_party(): I was asked to remove party %s, but no parties are defined", target_party->partyname);
82 return; 80 return;
83 } 81 }
84 82
85 for (pl = first_player; pl != NULL; pl = pl->next) 83 for_all_players (pl)
86 if (pl->party == target_party) 84 if (pl->party == target_party)
87 pl->party = NULL; 85 pl->party = NULL;
88 86
89 /* special case-ism for parties at the beginning and end of the list */ 87 /* special case-ism for parties at the beginning and end of the list */
90 if (target_party == firstparty) 88 if (target_party == firstparty)
150 return; /* we can't obsolete parties if there aren't any */ 148 return; /* we can't obsolete parties if there aren't any */
151 for (party = firstparty; party != NULL; party = next) 149 for (party = firstparty; party != NULL; party = next)
152 { 150 {
153 next = party->next; 151 next = party->next;
154 player_count = 0; 152 player_count = 0;
155 for (pl = first_player; pl != NULL; pl = pl->next) 153 for_all_players (pl)
156 if (pl->party == party) 154 if (pl->party == party)
157 player_count++; 155 player_count++;
158 if (player_count == 0) 156 if (player_count == 0)
159 remove_party (party); 157 remove_party (party);
160 } 158 }
216 op->contr->party = op->contr->party_to_join; 214 op->contr->party = op->contr->party_to_join;
217 op->contr->party_to_join = NULL; 215 op->contr->party_to_join = NULL;
218 new_draw_info_format (NDI_UNIQUE, 0, op, "You have joined party: %s\n", joined_party->partyname); 216 new_draw_info_format (NDI_UNIQUE, 0, op, "You have joined party: %s\n", joined_party->partyname);
219 snprintf (buf, MAX_BUF, "%s joins party %s", &op->name, joined_party->partyname); 217 snprintf (buf, MAX_BUF, "%s joins party %s", &op->name, joined_party->partyname);
220 send_party_message (op, buf); 218 send_party_message (op, buf);
221 op->contr->state = ST_PLAYING; 219 op->contr->ns->state = ST_PLAYING;
222 return; 220 return;
223 } 221 }
224 else 222 else
225 { 223 {
226 new_draw_info (NDI_UNIQUE, 0, op, "You entered the wrong password"); 224 new_draw_info (NDI_UNIQUE, 0, op, "You entered the wrong password");
227 op->contr->party_to_join = NULL; 225 op->contr->party_to_join = NULL;
228 op->contr->state = ST_PLAYING; 226 op->contr->ns->state = ST_PLAYING;
229 return; 227 return;
230 } 228 }
231} 229}
232 230
233void 231void
234send_party_message (object *op, char *msg) 232send_party_message (object *op, char *msg)
235{ 233{
236 player *pl; 234 player *pl;
237 235
238 for (pl = first_player; pl != NULL; pl = pl->next) 236 for_all_players (pl)
239 if (pl->ob->contr->party == op->contr->party && pl->ob != op) 237 if (pl->ob->contr->party == op->contr->party && pl->ob != op)
240 new_draw_info (NDI_WHITE, 0, pl->ob, msg); 238 new_draw_info (NDI_WHITE, 0, pl->ob, msg);
241} 239}
242 240
243int 241int
439 { 437 {
440 new_draw_info (NDI_UNIQUE, 0, op, "You are not a member of any party."); 438 new_draw_info (NDI_UNIQUE, 0, op, "You are not a member of any party.");
441 return 1; 439 return 1;
442 } 440 }
443 new_draw_info_format (NDI_UNIQUE, 0, op, "Members of party: %s.", op->contr->party->partyname); 441 new_draw_info_format (NDI_UNIQUE, 0, op, "Members of party: %s.", op->contr->party->partyname);
444 for (pl = first_player; pl != NULL; pl = pl->next) 442 for_all_players (pl)
445 if (pl->ob->contr->party == op->contr->party) 443 if (pl->ob->contr->party == op->contr->party)
446 { 444 {
447 if (settings.set_title == TRUE) 445 if (settings.set_title == TRUE)
448 { 446 {
449 if (pl->ob->contr->own_title[0] != '\0') 447 if (pl->ob->contr->own_title[0] != '\0')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines