--- deliantra/server/include/player.h 2006/09/04 11:07:59 1.12 +++ deliantra/server/include/player.h 2006/09/05 18:18:09 1.13 @@ -22,12 +22,11 @@ */ #define NUM_OUTPUT_BUFS 5 -typedef struct { +struct Output_Buf { shstr buf; /* Actual string pointer */ uint32 first_update; /* First time this message was stored */ uint16 count; /* How many times we got this message */ -} Output_Buf; - +}; /* wand/rod/horn rolled into range_misc. They all use the same body location * anyways. @@ -197,7 +196,6 @@ /* join */ char search_str[MAX_BUF]; /* Item we are looking for */ sint16 encumbrance; /* How much our player is encumbered */ - Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ uint16 outputs_sync; /* How often to print, no matter what */ uint16 outputs_count; /* Print if this count is exceeded */ object *mark; /* marked object */ @@ -211,5 +209,16 @@ { struct pl *next; /* Pointer to next player, NULL if this is last */ NewSocket socket; /* Socket information for this player */ + Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ + + void clear () + { + memset (static_cast(this), 0, sizeof (player_pod)); + attachable_clear (); + + for (int i = 0; i < NUM_OUTPUT_BUFS; i++) + outputs[i].buf = 0; + } } player; +