public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
* border_slide compensation problem
@ 2006-06-18 16:01 Ed Hurst-Frost
  2006-06-18 17:14 ` Lincoln Peters
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Hurst-Frost @ 2006-06-18 16:01 UTC (permalink / raw)
  To: xconq7

Hello. Although I've known xconq for a very long time, I've only recently 
started developing with it. This is my first posting to this list.

I'm hoping to start (yet another) xconq revival, but I'm not going to go 
into too much detail right now, because I've got a long way to go and anyway 
I'm not sure anyone's listening.

But to find out whether there is, I'll start by asking about a possible bug 
that's been hampering me:

It's in move.c rev 1.55, line 401:
if ((dist == 2 && !border_slide_possible(u, ox, oy, x, y)) && dist > 
u_move_range(u2)) return A_ANY_TOO_FAR;

If I understand correctly, this allows a border_slide to move a unit a 
distance of 2 even if its move_range is only 1.

But I have units whose move_range is greater than 1, and this line stops 
them moving.

Wouldn't it be better written:
if (dist > u_move_range(u2) + (border_slide_possible(u, ox, oy, x, y)?1:0)) 
return A_ANY_TOO_FAR;

This helps units with a move_range over 1, however it probably doesn't 
compensate for multiple slides between ox,oy and x,y. But I don't feel I 
understand border_slides enough yet to fix it completely.

Can anyone help? 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-18 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-18 16:01 border_slide compensation problem Ed Hurst-Frost
2006-06-18 17:14 ` Lincoln Peters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).