1 |
elmex |
1.1 |
/* |
2 |
root |
1.35 |
* This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 |
root |
1.30 |
* |
4 |
root |
1.62 |
* Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 |
root |
1.65 |
* Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 |
|
|
* Copyright (©) 1992 Frank Tore Johansen |
7 |
root |
1.30 |
* |
8 |
root |
1.55 |
* Deliantra is free software: you can redistribute it and/or modify it under |
9 |
|
|
* the terms of the Affero GNU General Public License as published by the |
10 |
|
|
* Free Software Foundation, either version 3 of the License, or (at your |
11 |
|
|
* option) any later version. |
12 |
root |
1.30 |
* |
13 |
root |
1.33 |
* This program is distributed in the hope that it will be useful, |
14 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
|
* GNU General Public License for more details. |
17 |
root |
1.30 |
* |
18 |
root |
1.55 |
* You should have received a copy of the Affero GNU General Public License |
19 |
|
|
* and the GNU General Public License along with this program. If not, see |
20 |
|
|
* <http://www.gnu.org/licenses/>. |
21 |
root |
1.30 |
* |
22 |
root |
1.35 |
* The authors can be reached via e-mail to <support@deliantra.net> |
23 |
root |
1.14 |
*/ |
24 |
elmex |
1.1 |
|
25 |
|
|
#include <global.h> |
26 |
|
|
|
27 |
root |
1.57 |
//+GPL |
28 |
|
|
|
29 |
elmex |
1.1 |
/* Determine if the attacktype represented by the |
30 |
|
|
* specified attack-number is enabled for dragon players. |
31 |
|
|
* A dragon player (quetzal) can gain resistances for |
32 |
|
|
* all enabled attacktypes. |
33 |
|
|
*/ |
34 |
root |
1.4 |
int |
35 |
|
|
atnr_is_dragon_enabled (int attacknr) |
36 |
|
|
{ |
37 |
elmex |
1.1 |
if (attacknr == ATNR_MAGIC || attacknr == ATNR_FIRE || |
38 |
root |
1.4 |
attacknr == ATNR_ELECTRICITY || attacknr == ATNR_COLD || attacknr == ATNR_ACID || attacknr == ATNR_POISON) |
39 |
elmex |
1.1 |
return 1; |
40 |
root |
1.10 |
|
41 |
elmex |
1.1 |
return 0; |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
/* |
45 |
root |
1.14 |
* If final is set, it a clean/final save, not a backup, ie dont remove objects from inventory |
46 |
|
|
*/ |
47 |
|
|
bool |
48 |
|
|
player::save_pl (object_freezer &freezer) |
49 |
|
|
{ |
50 |
|
|
INVOKE_PLAYER (SAVE, ob->contr); |
51 |
|
|
|
52 |
|
|
int wiz = ob->flag [FLAG_WIZ]; |
53 |
|
|
|
54 |
|
|
/* Eneq(@csd.uu.se): If we have an open container hide it. */ |
55 |
root |
1.56 |
object *container = ob->container_ (); |
56 |
root |
1.14 |
ob->container = 0; |
57 |
|
|
|
58 |
root |
1.19 |
if (ob->map) |
59 |
|
|
maplevel = ob->map->path; |
60 |
|
|
|
61 |
root |
1.60 |
#define PL_OUT(k) freezer.put (KW(k), k) |
62 |
|
|
#define PL_OUT2(k,v) freezer.put (KW(k), v) |
63 |
root |
1.14 |
|
64 |
|
|
PL_OUT (password); |
65 |
|
|
PL_OUT2 (title, own_title); |
66 |
root |
1.32 |
PL_OUT (gender); |
67 |
root |
1.41 |
PL_OUT (hintmode); |
68 |
root |
1.14 |
PL_OUT (gen_hp); |
69 |
|
|
PL_OUT (gen_sp); |
70 |
|
|
PL_OUT (gen_grace); |
71 |
|
|
PL_OUT (bowtype); |
72 |
|
|
PL_OUT (petmode); |
73 |
|
|
PL_OUT (peaceful); |
74 |
|
|
PL_OUT (digestion); |
75 |
|
|
PL_OUT2 (pickup, mode); |
76 |
|
|
PL_OUT (outputs_sync); |
77 |
|
|
PL_OUT (outputs_count); |
78 |
|
|
|
79 |
root |
1.60 |
freezer.put (KW(usekeys), usekeys == key_inventory ? CS(key_inventory) : (usekeys == keyrings ? CS(keyrings) : CS(containers))); |
80 |
|
|
freezer.put (KW(unapply), unapply == unapply_nochoice ? CS(unapply_nochoice) : (unapply == unapply_never ? CS(unapply_never) : CS(unapply_always))); |
81 |
root |
1.14 |
|
82 |
root |
1.17 |
PL_OUT2 (map, maplevel); |
83 |
root |
1.14 |
PL_OUT (savebed_map); |
84 |
|
|
PL_OUT (bed_x); |
85 |
|
|
PL_OUT (bed_y); |
86 |
|
|
PL_OUT (weapon_sp); |
87 |
root |
1.28 |
PL_OUT (weapon_sp_left); |
88 |
root |
1.64 |
PL_OUT2 (str, orig_stats.Str); |
89 |
|
|
PL_OUT2 (dex, orig_stats.Dex); |
90 |
|
|
PL_OUT2 (con, orig_stats.Con); |
91 |
|
|
PL_OUT2 (int, orig_stats.Int); |
92 |
|
|
PL_OUT2 (pow, orig_stats.Pow); |
93 |
|
|
PL_OUT2 (wis, orig_stats.Wis); |
94 |
|
|
PL_OUT2 (cha, orig_stats.Cha); |
95 |
root |
1.14 |
|
96 |
root |
1.15 |
PL_OUT2 (lev_array, 10); |
97 |
root |
1.14 |
|
98 |
root |
1.15 |
for (int i = 1; i <= 10; i++) |
99 |
root |
1.14 |
{ |
100 |
root |
1.29 |
freezer.add (levhp [i]); freezer.add ('\n'); |
101 |
|
|
freezer.add (levsp [i]); freezer.add ('\n'); |
102 |
|
|
freezer.add (levgrace[i]); freezer.add ('\n'); |
103 |
root |
1.14 |
} |
104 |
|
|
|
105 |
|
|
freezer.put (ob->contr); |
106 |
root |
1.60 |
freezer.put (KW(endplst)); |
107 |
root |
1.14 |
|
108 |
|
|
CLEAR_FLAG (ob, FLAG_WIZ); |
109 |
root |
1.21 |
ob->write (freezer); |
110 |
root |
1.14 |
|
111 |
|
|
/* Eneq(@csd.uu.se): Reveal the container if we have one. */ |
112 |
|
|
ob->container = container; |
113 |
|
|
|
114 |
|
|
ob->flag [FLAG_WIZ] = wiz; |
115 |
|
|
|
116 |
|
|
INVOKE_PLAYER (SAVE_DONE, ob->contr); |
117 |
|
|
|
118 |
|
|
return true; |
119 |
|
|
} |
120 |
|
|
|
121 |
root |
1.57 |
//-GPL |
122 |
|
|
|
123 |
root |
1.14 |
bool |
124 |
|
|
player::save_pl (const char *path) |
125 |
|
|
{ |
126 |
|
|
object_freezer freezer; |
127 |
|
|
|
128 |
|
|
if (!save_pl (freezer)) |
129 |
|
|
return false; |
130 |
|
|
|
131 |
|
|
return freezer.save (path); |
132 |
|
|
} |
133 |
|
|
|
134 |
|
|
player * |
135 |
root |
1.21 |
player::load_pl (object_thawer &f) |
136 |
root |
1.14 |
{ |
137 |
root |
1.21 |
int maxerrs = 20; |
138 |
root |
1.18 |
|
139 |
root |
1.14 |
player *pl = new player; |
140 |
|
|
|
141 |
|
|
pl->savebed_map = first_map_path; |
142 |
|
|
|
143 |
|
|
/* Loop through the file, loading the rest of the values */ |
144 |
|
|
for (;;) |
145 |
|
|
{ |
146 |
root |
1.21 |
switch (f.kw) |
147 |
root |
1.14 |
{ |
148 |
|
|
case KW_EOF: |
149 |
root |
1.21 |
LOG (llevError, "%s: unexpected EOF while reading player header\n", f.name); |
150 |
root |
1.18 |
goto failure; |
151 |
|
|
|
152 |
|
|
default: |
153 |
root |
1.21 |
LOG (llevError, "%s: skipping unknown key in player header: %s\n", f.name, f.kw_str); |
154 |
root |
1.18 |
if (!--maxerrs) goto failure; |
155 |
|
|
break; |
156 |
root |
1.14 |
|
157 |
|
|
case KW_ERROR: |
158 |
root |
1.21 |
LOG (llevError, "%s: parse error while reading player header, skipping (%s,%s).\n", f.name, f.kw_str, f.value); |
159 |
root |
1.18 |
if (!--maxerrs) goto failure; |
160 |
root |
1.14 |
break; |
161 |
|
|
|
162 |
|
|
case KW_endplst: |
163 |
root |
1.21 |
f.next (); |
164 |
|
|
|
165 |
|
|
if (object *op = pl->ob->read (f)) |
166 |
|
|
pl->set_object (op); |
167 |
|
|
else |
168 |
|
|
goto failure; |
169 |
|
|
|
170 |
|
|
INVOKE_PLAYER (LOAD, pl); |
171 |
root |
1.14 |
|
172 |
root |
1.21 |
return pl; |
173 |
|
|
|
174 |
|
|
case KW_oid: f.get (pl, f.get_sint32 ()); break; |
175 |
|
|
case KW_password: assign (pl->password , f.get_str ()); break; |
176 |
|
|
case KW_title: assign (pl->own_title, f.get_str ()); break; |
177 |
|
|
case KW_bowtype: pl->bowtype = (bowtype_t) f.get_sint32 (); break; |
178 |
|
|
case KW_petmode: pl->petmode = (petmode_t) f.get_sint32 (); break; |
179 |
root |
1.32 |
case KW_gender: f.get (pl->gender); break; |
180 |
root |
1.41 |
case KW_hintmode: f.get (pl->hintmode); break; |
181 |
root |
1.40 |
case KW_listening: /*TODO*/; break; |
182 |
root |
1.21 |
case KW_peaceful: f.get (pl->peaceful); break; |
183 |
|
|
case KW_digestion: f.get (pl->digestion); break; |
184 |
|
|
case KW_pickup: f.get (pl->mode); break; |
185 |
|
|
case KW_outputs_sync: f.get (pl->outputs_sync); break; |
186 |
|
|
case KW_outputs_count: f.get (pl->outputs_count); break; |
187 |
|
|
case KW_map: f.get (pl->maplevel); break; |
188 |
|
|
case KW_savebed_map: f.get (pl->savebed_map); break; |
189 |
|
|
case KW_bed_x: f.get (pl->bed_x); break; |
190 |
|
|
case KW_bed_y: f.get (pl->bed_y); break; |
191 |
|
|
case KW_weapon_sp: f.get (pl->weapon_sp); break; |
192 |
root |
1.28 |
case KW_weapon_sp_left:f.get (pl->weapon_sp_left); break; |
193 |
root |
1.64 |
|
194 |
|
|
case KW_Str: // uppercase alias |
195 |
|
|
case KW_str: f.get (pl->orig_stats.Str); break; |
196 |
|
|
case KW_Dex: // uppercase alias |
197 |
|
|
case KW_dex: f.get (pl->orig_stats.Dex); break; |
198 |
|
|
case KW_Con: // uppercase alias |
199 |
|
|
case KW_con: f.get (pl->orig_stats.Con); break; |
200 |
|
|
case KW_Int: // uppercase alias |
201 |
|
|
case KW_int: f.get (pl->orig_stats.Int); break; |
202 |
|
|
case KW_Pow: // uppercase alias |
203 |
|
|
case KW_pow: f.get (pl->orig_stats.Pow); break; |
204 |
|
|
case KW_Wis: // uppercase alias |
205 |
|
|
case KW_wis: f.get (pl->orig_stats.Wis); break; |
206 |
|
|
case KW_Cha: // uppercase alias |
207 |
|
|
case KW_cha: f.get (pl->orig_stats.Cha); break; |
208 |
|
|
|
209 |
root |
1.21 |
case KW_gen_hp: f.get (pl->gen_hp); break; |
210 |
|
|
case KW_gen_sp: f.get (pl->gen_sp); break; |
211 |
|
|
case KW_gen_grace: f.get (pl->gen_grace); break; |
212 |
root |
1.14 |
|
213 |
|
|
case KW_usekeys: |
214 |
root |
1.21 |
if (!strcmp (f.get_str (), "key_inventory")) |
215 |
root |
1.14 |
pl->usekeys = key_inventory; |
216 |
root |
1.21 |
else if (!strcmp (f.get_str (), "keyrings")) |
217 |
root |
1.14 |
pl->usekeys = keyrings; |
218 |
root |
1.21 |
else if (!strcmp (f.get_str (), "containers")) |
219 |
root |
1.14 |
pl->usekeys = containers; |
220 |
|
|
else |
221 |
root |
1.21 |
LOG (llevDebug, "load_player: got unknown usekeys type: %s\n", f.get_str ()); |
222 |
root |
1.14 |
break; |
223 |
|
|
|
224 |
|
|
case KW_unapply: |
225 |
root |
1.21 |
if (!strcmp (f.get_str (), "unapply_nochoice")) |
226 |
root |
1.14 |
pl->unapply = unapply_nochoice; |
227 |
root |
1.21 |
else if (!strcmp (f.get_str (), "unapply_never")) |
228 |
root |
1.14 |
pl->unapply = unapply_never; |
229 |
root |
1.21 |
else if (!strcmp (f.get_str (), "unapply_always")) |
230 |
root |
1.14 |
pl->unapply = unapply_always; |
231 |
|
|
else |
232 |
root |
1.21 |
LOG (llevDebug, "load_player: got unknown unapply type: %s\n", f.get_str ()); |
233 |
root |
1.14 |
break; |
234 |
|
|
|
235 |
|
|
case KW_lev_array: |
236 |
|
|
{ |
237 |
root |
1.21 |
int count = f.get_sint32 (); |
238 |
root |
1.14 |
|
239 |
|
|
for (int i = 1; i <= count; i++) |
240 |
|
|
{ |
241 |
root |
1.16 |
char line [32]; |
242 |
root |
1.14 |
|
243 |
root |
1.21 |
fgets (line, 32, f); pl->levhp [i] = atoi (line); |
244 |
|
|
fgets (line, 32, f); pl->levsp [i] = atoi (line); |
245 |
|
|
fgets (line, 32, f); pl->levgrace[i] = atoi (line); |
246 |
root |
1.14 |
} |
247 |
|
|
} |
248 |
|
|
break; |
249 |
|
|
} |
250 |
|
|
|
251 |
root |
1.21 |
f.next (); |
252 |
root |
1.14 |
} |
253 |
|
|
|
254 |
root |
1.18 |
failure: |
255 |
root |
1.21 |
LOG (llevError, "%s: too many or too grave errors, aborting player load.\n", f.name); |
256 |
root |
1.18 |
|
257 |
root |
1.22 |
if (pl->ob) |
258 |
root |
1.47 |
pl->ob->destroy (); |
259 |
root |
1.22 |
|
260 |
root |
1.18 |
pl->destroy (); |
261 |
|
|
|
262 |
|
|
return 0; |
263 |
root |
1.14 |
} |
264 |
|
|
|
265 |
root |
1.61 |
const_utf8_string |
266 |
root |
1.37 |
player::killer_name () const |
267 |
|
|
{ |
268 |
|
|
static char buf [2048]; |
269 |
|
|
|
270 |
|
|
if (!killer) |
271 |
|
|
return "a dungeon collapse"; |
272 |
|
|
else if (killer->contr) |
273 |
root |
1.39 |
snprintf (buf, sizeof (buf), "%s the %s", &killer->name, |
274 |
|
|
*killer->contr->own_title ? killer->contr->own_title : killer->contr->title); |
275 |
root |
1.37 |
else if (killer->type == DEEP_SWAMP) |
276 |
|
|
snprintf (buf, sizeof (buf), "drowning in a %s", &killer->name); |
277 |
|
|
else if (killer->owner) |
278 |
root |
1.38 |
snprintf (buf, sizeof (buf), "%s's %s", &killer->outer_owner ()->name, &killer->name); |
279 |
root |
1.37 |
else |
280 |
|
|
return &killer->name; |
281 |
|
|
|
282 |
|
|
return buf; |
283 |
|
|
} |
284 |
|
|
|
285 |
root |
1.41 |
// expand one level of cfpod |
286 |
root |
1.43 |
// end == -2, till '\n' |
287 |
|
|
// end == -1, till '>' |
288 |
|
|
// end == 0, till eos |
289 |
|
|
// end >= 1, levels of " >>>" |
290 |
root |
1.41 |
static const char * |
291 |
root |
1.44 |
expand_cfpod (const player *pl, dynbuf_text &buf, const char *cfpod, int end = 0) |
292 |
root |
1.41 |
{ |
293 |
|
|
static dynbuf_text nest(128, 128); |
294 |
|
|
|
295 |
|
|
for (;;) |
296 |
|
|
switch (char ch = *cfpod++) |
297 |
|
|
{ |
298 |
|
|
case 0: |
299 |
|
|
return cfpod - 1; |
300 |
|
|
|
301 |
|
|
case ' ': |
302 |
root |
1.44 |
// verbatim block? |
303 |
|
|
if (!buf.size () && !end) |
304 |
|
|
{ |
305 |
|
|
--cfpod; |
306 |
|
|
goto verbatim; |
307 |
|
|
} |
308 |
|
|
|
309 |
root |
1.43 |
if (end < 1) |
310 |
root |
1.41 |
goto passthrough; |
311 |
|
|
|
312 |
|
|
for (int i = 0; i < end; ++i) |
313 |
|
|
if (cfpod [i] != '>') |
314 |
|
|
goto passthrough; |
315 |
|
|
|
316 |
|
|
return cfpod + end; |
317 |
|
|
|
318 |
|
|
case '>': |
319 |
root |
1.43 |
if (end != -1) |
320 |
root |
1.41 |
{ |
321 |
|
|
buf << ">"; |
322 |
|
|
break; |
323 |
|
|
} |
324 |
|
|
|
325 |
|
|
return cfpod; |
326 |
|
|
|
327 |
|
|
case '&': |
328 |
|
|
buf << "&"; |
329 |
|
|
break; |
330 |
|
|
|
331 |
|
|
case '<': |
332 |
|
|
buf << "<"; |
333 |
|
|
break; |
334 |
|
|
|
335 |
root |
1.42 |
case '\r': |
336 |
|
|
buf << '\n'; |
337 |
root |
1.52 |
/* \r\n+ becomes one or more newlines */ |
338 |
|
|
while (*cfpod == '\n') |
339 |
|
|
buf << *cfpod++; |
340 |
root |
1.42 |
break; |
341 |
|
|
|
342 |
root |
1.41 |
case '\n': |
343 |
root |
1.43 |
if (end == -2) |
344 |
|
|
return cfpod; |
345 |
|
|
|
346 |
|
|
// \n\ => newline, tt |
347 |
|
|
// \n\n => \n\n |
348 |
|
|
// \n => single space |
349 |
|
|
|
350 |
|
|
// two or more newlines will be copied verbatim, one is replaced by space |
351 |
|
|
if (*cfpod == '\n') |
352 |
root |
1.41 |
{ |
353 |
|
|
--cfpod; |
354 |
root |
1.42 |
do |
355 |
root |
1.41 |
buf << *cfpod++; |
356 |
root |
1.42 |
while (*cfpod == '\n'); |
357 |
root |
1.41 |
} |
358 |
root |
1.50 |
else if (*cfpod == ' ') |
359 |
|
|
buf << '\n'; |
360 |
|
|
else |
361 |
root |
1.42 |
buf << ' '; |
362 |
root |
1.41 |
|
363 |
root |
1.44 |
// verbatim block? |
364 |
root |
1.43 |
if (*cfpod == ' ') |
365 |
root |
1.44 |
goto verbatim; |
366 |
root |
1.43 |
|
367 |
root |
1.41 |
break; |
368 |
|
|
|
369 |
|
|
case 'B': case 'C': case 'E': case 'G': |
370 |
|
|
case 'H': case 'I': case 'T': case 'U': |
371 |
|
|
case 'Z': |
372 |
|
|
{ |
373 |
root |
1.43 |
int end = 0; |
374 |
root |
1.41 |
|
375 |
root |
1.43 |
while (cfpod [end] == '<') |
376 |
|
|
++end; |
377 |
root |
1.41 |
|
378 |
root |
1.43 |
if (!end) |
379 |
root |
1.41 |
goto passthrough; |
380 |
|
|
|
381 |
root |
1.43 |
if (end == 1 || cfpod [end] != ' ') |
382 |
root |
1.41 |
{ |
383 |
root |
1.43 |
end = -1; |
384 |
root |
1.41 |
++cfpod; |
385 |
|
|
} |
386 |
|
|
else |
387 |
root |
1.43 |
cfpod += end + 1; |
388 |
root |
1.41 |
|
389 |
|
|
const char *pfx, *sfx; |
390 |
|
|
|
391 |
|
|
switch (ch) |
392 |
|
|
{ |
393 |
|
|
case 'B': pfx = "<b>" ; sfx = "</b>" ; break; |
394 |
|
|
case 'C': pfx = "<tt>" ; sfx = "</tt>" ; break; |
395 |
|
|
case 'E': pfx = "&" ; sfx = ";" ; break; |
396 |
|
|
case 'I': pfx = "<i>" ; sfx = "</i>" ; break; |
397 |
|
|
case 'U': pfx = "<u>" ; sfx = "</u>" ; break; |
398 |
|
|
case 'T': pfx = "<big><b>"; sfx = "</b></big>"; break; |
399 |
elmex |
1.51 |
case 'Z': pfx = "" ; sfx = "" ; break; |
400 |
root |
1.41 |
|
401 |
|
|
case 'H': // hint |
402 |
|
|
{ |
403 |
|
|
if (pl->hintmode) |
404 |
|
|
{ |
405 |
root |
1.43 |
cfpod = expand_cfpod (pl, nest, cfpod, end); |
406 |
root |
1.41 |
nest.clear (); |
407 |
|
|
|
408 |
|
|
if (pl->hintmode == 1) |
409 |
root |
1.53 |
buf << "<fg name=\"lightblue\">[Hint available]</fg>"; |
410 |
root |
1.41 |
else |
411 |
root |
1.53 |
while (*cfpod <= ' '&& *cfpod) // eat trailing whitespace |
412 |
root |
1.41 |
++cfpod; |
413 |
|
|
|
414 |
|
|
goto skip; |
415 |
|
|
} |
416 |
|
|
else |
417 |
|
|
{ |
418 |
root |
1.53 |
pfx = "<fg name=\"lightblue\">[Hint: "; |
419 |
|
|
sfx = "]</fg>"; |
420 |
root |
1.41 |
} |
421 |
|
|
} |
422 |
|
|
break; |
423 |
|
|
|
424 |
|
|
case 'G': // gender |
425 |
|
|
{ |
426 |
root |
1.45 |
cfpod = expand_cfpod (pl, nest, cfpod, end); |
427 |
root |
1.41 |
nest << '\0'; // zero-terminate |
428 |
|
|
|
429 |
|
|
const char *str = nest.linearise (); |
430 |
|
|
const char *sep = strchr (str, '|'); |
431 |
|
|
|
432 |
|
|
if (sep) |
433 |
|
|
{ |
434 |
root |
1.45 |
if (pl->gender) |
435 |
root |
1.41 |
buf.add (sep + 1, nest.size () - (sep - str) - 2); |
436 |
|
|
else |
437 |
|
|
buf.add (str, sep - str); |
438 |
|
|
} |
439 |
|
|
|
440 |
|
|
nest.clear (); |
441 |
|
|
|
442 |
|
|
goto skip; |
443 |
|
|
} |
444 |
root |
1.58 |
|
445 |
|
|
default: |
446 |
|
|
pfx = "UNKNOWN_DIRECTIVE{"; |
447 |
|
|
sfx = "}"; |
448 |
|
|
break; |
449 |
root |
1.41 |
} |
450 |
|
|
|
451 |
|
|
buf << pfx; |
452 |
root |
1.43 |
cfpod = expand_cfpod (pl, buf, cfpod, end); |
453 |
root |
1.41 |
buf << sfx; |
454 |
|
|
} |
455 |
|
|
|
456 |
|
|
break; |
457 |
|
|
|
458 |
|
|
default: |
459 |
|
|
passthrough: |
460 |
|
|
buf << ch; |
461 |
|
|
skip: |
462 |
|
|
break; |
463 |
root |
1.44 |
|
464 |
|
|
verbatim: |
465 |
|
|
// elements cannot currently span multiple lines |
466 |
|
|
do |
467 |
|
|
{ |
468 |
|
|
buf << "<tt>"; |
469 |
|
|
cfpod = expand_cfpod (pl, buf, cfpod, -2); |
470 |
|
|
buf << "</tt>\n"; |
471 |
root |
1.48 |
|
472 |
|
|
while (*cfpod == '\n') |
473 |
|
|
buf << *cfpod++; |
474 |
root |
1.44 |
} |
475 |
|
|
while (*cfpod == ' '); |
476 |
|
|
|
477 |
|
|
break; |
478 |
root |
1.41 |
} |
479 |
|
|
} |
480 |
|
|
|
481 |
|
|
dynbuf_text * |
482 |
|
|
player::expand_cfpod (const char *cfpod) const |
483 |
|
|
{ |
484 |
|
|
static dynbuf_text buf(1024, 1024); |
485 |
|
|
buf.clear (); |
486 |
|
|
|
487 |
root |
1.44 |
::expand_cfpod (this, buf, cfpod); |
488 |
root |
1.41 |
|
489 |
|
|
return &buf; |
490 |
|
|
} |
491 |
|
|
|