… | |
… | |
260 | * to check for objects to make sure there are no common errors. |
260 | * to check for objects to make sure there are no common errors. |
261 | */ |
261 | */ |
262 | void |
262 | void |
263 | object::post_load_check () |
263 | object::post_load_check () |
264 | { |
264 | { |
265 | // as a kind of a hack, we now adjust the range, shield and combat slots |
|
|
266 | switch (type) |
265 | switch (type) |
267 | { |
266 | { |
268 | case BOW: |
267 | case BOW: |
269 | case WAND: |
268 | case WAND: |
270 | case ROD: |
269 | case ROD: |
271 | case HORN: |
270 | case HORN: |
272 | case SKILL: // maybe have to think about this one, as skills get applied togethr with their governing weapons |
|
|
273 | case SKILL_TOOL: |
|
|
274 | if (slot [body_range].info != 1) |
271 | if (slot [body_range].info != -1) |
275 | { |
272 | { |
276 | LOG (llevInfo, "%s: body_range %d != 1\n", debug_desc (), slot [body_range].info); |
273 | LOG (llevError, "%s: body_range %d != -1\n", debug_desc (), slot [body_range].info); |
277 | slot [body_range].info = 1; |
274 | slot [body_range].info = -1; |
278 | } |
275 | } |
279 | break; |
276 | break; |
280 | |
277 | |
281 | case WEAPON: |
278 | case WEAPON: |
282 | if (slot [body_combat].info != 1) |
279 | if (slot [body_combat].info != -1) |
283 | { |
280 | { |
284 | LOG (llevInfo, "%s: body_combat %d != 1\n", debug_desc (), slot [body_combat].info); |
281 | LOG (llevError, "%s: body_combat %d != -1\n", debug_desc (), slot [body_combat].info); |
285 | slot [body_combat].info = 1; |
282 | slot [body_combat].info = -1; |
286 | } |
283 | } |
287 | break; |
284 | break; |
288 | |
285 | |
289 | case SHIELD: |
286 | case SHIELD: |
290 | if (slot [body_shield].info != 1) |
287 | if (slot [body_shield].info != -1) |
291 | { |
288 | { |
292 | LOG (llevInfo, "%s: body_shield %d != 1\n", debug_desc (), slot [body_shield].info); |
289 | LOG (llevError, "%s: body_shield %d != -1\n", debug_desc (), slot [body_shield].info); |
293 | slot [body_shield].info = 1; |
290 | slot [body_shield].info = -1; |
294 | } |
291 | } |
295 | break; |
292 | break; |
296 | |
293 | |
297 | case PLAYER: |
294 | case PLAYER: |
298 | if (slot [body_shield].info != 1) |
295 | if (slot [body_shield].info != 1) |
299 | { |
296 | { |
300 | LOG (llevInfo, "%s: body_shield %d != 1\n", debug_desc (), slot [body_shield].info); |
297 | LOG (llevError, "%s: body_shield %d != 1\n", debug_desc (), slot [body_shield].info); |
301 | slot [body_shield].info = 1; |
298 | slot [body_shield].info = 1; |
302 | } |
299 | } |
303 | |
300 | |
304 | if (slot [body_combat].info != 1) |
301 | if (slot [body_combat].info != 1) |
305 | { |
302 | { |
306 | LOG (llevInfo, "%s: body_shield %d != 1\n", debug_desc (), slot [body_combat].info); |
303 | LOG (llevError, "%s: body_combat %d != 1\n", debug_desc (), slot [body_combat].info); |
307 | slot [body_combat].info = 1; |
304 | slot [body_combat].info = 1; |
|
|
305 | } |
|
|
306 | |
|
|
307 | if (slot [body_range].info != 1) |
|
|
308 | { |
|
|
309 | LOG (llevError, "%s: body_range %d != 1\n", debug_desc (), slot [body_range].info); |
|
|
310 | slot [body_range].info = 1; |
308 | } |
311 | } |
309 | break; |
312 | break; |
310 | } |
313 | } |
311 | |
314 | |
312 | /* We do some specialised handling to handle legacy cases of name_pl. |
315 | /* We do some specialised handling to handle legacy cases of name_pl. |
… | |
… | |
324 | if (!name_pl) |
327 | if (!name_pl) |
325 | name_pl = name; |
328 | name_pl = name; |
326 | |
329 | |
327 | /* objects now have a materialname. try to patch it in */ |
330 | /* objects now have a materialname. try to patch it in */ |
328 | if (!(is_weapon () && level > 0)) |
331 | if (!(is_weapon () && level > 0)) |
329 | { |
|
|
330 | if (map != NULL) |
|
|
331 | set_materialname (this, map->difficulty, NULL); |
332 | set_materialname (this, map ? map->difficulty : 5, 0); |
332 | else |
|
|
333 | set_materialname (this, 5, NULL); |
|
|
334 | } |
|
|
335 | |
333 | |
336 | /* only do these when program is first run - a bit |
334 | /* only do these when program is first run - a bit |
337 | * excessive to do this at every run - most of this is |
335 | * excessive to do this at every run - most of this is |
338 | * really just to catch any errors - program will still run, but |
336 | * really just to catch any errors - program will still run, but |
339 | * not in the ideal fashion. |
337 | * not in the ideal fashion. |