Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] (PR#9006) player_in_territory() function
Home

[Freeciv-Dev] (PR#9006) player_in_territory() function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9006) player_in_territory() function
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Jun 2004 19:25:13 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9006 >

> [use_less - Tue Jun 22 08:41:03 2004]:
> 
> Just uploading a working version, using get_transporter_occupancy,
> though that function doesn't work on the client for other unallied civ's
> units.

There's still a problem with transported units.  For allied players
can_player_see_unit is TRUE, but you also increment for the transported
unit.  Fixing this probably means adding a
can_player_see_transported_units(pplayer1, pplayer2) function to avoid
duplicating the logic.

Or you could just make the function return a boolean?

> Also, this version uses the original implementation, since it should be
> faster on the client since the client is only aware of units it can see
> anyway.  That makes logical sense to me, though the reality may be
> different. :)

The client numbers may not be accurate, but at least the client should
always know whether the number is zero or not.

Unless...the "enemy" player has a unit inside their ally's transporter
inside our territory.  Then we can see the enemy's ally's transporter
but not the enemy's unit.  Nothing to do about that, either at client or
server.  I guess this would therefore become a tricky sneak attack method?

jason



[Prev in Thread] Current Thread [Next in Thread]