bolts without friendlyfire get eaten by friends

Moderator: Moderator

Post Reply
Message
Author
Dekar
Spiderkin
Posts: 559
Joined: Wed Jan 26, 2011 3:47 pm

bolts without friendlyfire get eaten by friends

#1 Post by Dekar »

Bolts with friendlyfire=false disappear instead of passing through friendlies.
I think this should be changed or at least a new projectile type added with this functionality.

Already located a possible fix:

In engine/target.lua line 264:

Code: Select all

				-- If we explode due to something other than terrain, then we should explode ON the tile, not before it
				elseif typ.stop_block then
					local nb = game.level.map:checkAllEntitiesCount(lx, ly, "block_move")
					if nb > 1 or (nb == 1 and game.level.map:checkAllEntities(lx, ly, "block_move") and not game.level.map:checkEntity(lx, ly, engine.Map.TERRAIN, "pass_projectile")) then
						if for_highlights then

If local nb = game.level.map:checkAllEntitiesCount(lx, ly, "block_move") gets changed to substract the amount of actors friendly to the source actor it should work.

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: bolts without friendlyfire get eaten by friends

#2 Post by yufra »

Yeah, friendlyfire isn't so friendly with Projectiles at the moment. This is on my todo list but feel free to bump it if you don't hear from me in a while...
<DarkGod> lets say it's intended

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: bolts without friendlyfire get eaten by friends

#3 Post by yufra »

Tiger_eye and I put some time into this and have created a "friendlybock" branch on Gitorious. You can now add a "friendlyblock=false" flag to a target definition to allow friendly actors to not stop a bolt (or other things with the "stopblock=true" flag). Please test it out!
<DarkGod> lets say it's intended

Dekar
Spiderkin
Posts: 559
Joined: Wed Jan 26, 2011 3:47 pm

Re: bolts without friendlyfire get eaten by friends

#4 Post by Dekar »

Minor aesthetic bug: The path, when targeting, still shows tiles behind friendlies blocked in red.

But functionality seems to be ok. :D

Dekar
Spiderkin
Posts: 559
Joined: Wed Jan 26, 2011 3:47 pm

Re: bolts without friendlyfire get eaten by friends

#5 Post by Dekar »

Coding mistake by me, everything seems to be fine so far. :D

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: bolts without friendlyfire get eaten by friends

#6 Post by yufra »

I'll be pointing this out to DG soon, so keep testing!
<DarkGod> lets say it's intended

Post Reply