[Freeciv-Dev] Re: (PR#9006) player_in_territory() function
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9006 >
James Canete wrote:
> -added transporter count. On server counts all units, on client counts
> one extra unit.
> By the way, should I be benchmarking with --enable-debug=no? I think
> that still enables "set timeout -1", but I'm not sure. The above timing
> was with default debug settings.
It shouldn't matter, since you're just looking for a comparison.
> I placed this function in common/players.c so the client can do its own
> check for enemy units in territory before sending an expel enemy units
> demand.
>
> However, this check will be duplicated at the server to prevent
> cheating, so it may be a waste of time to do it on client-side.
There seems to be an error in the patch:
+ in_territory += 1 + punit->occupy;
+ if punit->is_occupied
+ }
also, I don't think we should have checks like "if (is_server())" in the
code unless they're absolutely necessary. And, the server should not
count all units being transported since that is cheating (although it
may be okay if you do a handicap check first).
And, doing a preliminary check at the client is a good idea. At least,
that's what we do in most other places.
jason
|
|