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

Comparing deliantra/server/server/spell_attack.C (file contents):
Revision 1.93 by root, Sun Nov 29 17:41:08 2009 UTC vs.
Revision 1.95 by elmex, Tue Jan 19 16:13:05 2010 UTC

660 return 0; 660 return 0;
661 } 661 }
662 662
663 tmp->map = newmap; 663 tmp->map = newmap;
664 664
665 // in case the bullet has direction 0 we explode it in place.
666 // direction 0 is possible for instance when a poison cloud trap springs.
667 if (tmp->direction == 0)
668 {
669 if (tmp->other_arch
670 && (tmp = tmp->insert_at (tmp, op))) // insert before explode cleanly
671 explode_bullet (tmp); // explode object will/should remove tmp
672 else
673 tmp->destroy ();
674
675 return 0;
676 }
677
665 if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y))) 678 if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (tmp->map, tmp->x, tmp->y)))
666 { 679 {
667 if (!QUERY_FLAG (tmp, FLAG_REFLECTING)) 680 if (!QUERY_FLAG (tmp, FLAG_REFLECTING))
668 { 681 {
669 tmp->destroy (); 682 tmp->destroy ();
1292 unordered_mapwalk (op, -range, -range, range, range) 1305 unordered_mapwalk (op, -range, -range, range, range)
1293 { 1306 {
1294 mapspace &ms = m->at (nx, ny); 1307 mapspace &ms = m->at (nx, ny);
1295 1308
1296 if (ms.flags () & P_IS_ALIVE) 1309 if (ms.flags () & P_IS_ALIVE)
1297 for (object *tmp = ms.bot; tmp; tmp = tmp->above) 1310 for (object *next, *tmp = ms.bot; tmp; tmp = next)
1311 {
1312 next = tmp->above;
1313
1298 if (tmp->flag [FLAG_ALIVE] || tmp->is_player ()) 1314 if (tmp->flag [FLAG_ALIVE] || tmp->is_player ())
1299 { 1315 {
1300 tmp = tmp->head_ (); 1316 tmp = tmp->head_ ();
1301 1317
1302 if ((friendly && !tmp->flag [FLAG_FRIENDLY] && !tmp->is_player ()) 1318 if ((friendly && !tmp->flag [FLAG_FRIENDLY] && !tmp->is_player ())
1303 || (!friendly && (tmp->flag [FLAG_FRIENDLY] || tmp->is_player ()))) 1319 || (!friendly && (tmp->flag [FLAG_FRIENDLY] || tmp->is_player ())))
1304 { 1320 {
1305 if (spell_ob->subtype == SP_DESTRUCTION) 1321 if (spell_ob->subtype == SP_DESTRUCTION)
1306 { 1322 {
1307 hit_player (tmp, dam, op, spell_ob->attacktype, 0); 1323 hit_player (tmp, dam, op, spell_ob->attacktype, 0);
1308 1324
1309 if (spell_ob->other_arch) 1325 if (spell_ob->other_arch)
1310 m->insert (spell_ob->other_arch->instance (), nx, ny, op); 1326 m->insert (spell_ob->other_arch->instance (), nx, ny, op);
1311 } 1327 }
1312 else if (spell_ob->subtype == SP_FAERY_FIRE && tmp->resist [ATNR_MAGIC] != 100) 1328 else if (spell_ob->subtype == SP_FAERY_FIRE && tmp->resist [ATNR_MAGIC] != 100)
1313 { 1329 {
1314 if (make_object_glow (tmp, 1, dur) && spell_ob->other_arch) 1330 if (make_object_glow (tmp, 1, dur) && spell_ob->other_arch)
1315 m->insert (spell_ob->other_arch->instance (), nx, ny, op); 1331 m->insert (spell_ob->other_arch->instance (), nx, ny, op);
1316 } 1332 }
1317 } 1333 }
1318 } 1334 }
1335 }
1319 } 1336 }
1320 1337
1321 op->skill = skill; 1338 op->skill = skill;
1322 return 1; 1339 return 1;
1323} 1340}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines