Complete.Org: Mailing Lists: Archives: freeciv-dev: February 1999:
[Freeciv-Dev] spaceship buglet
Home

[Freeciv-Dev] spaceship buglet

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] spaceship buglet
From: Massimo Campostrini <campo@xxxxxxxxxxxxxxxxxxxxx>
Date: 16 Feb 1999 09:22:57 +0100
Reply-to: freeciv-dev@xxxxxxxxxxx

If you launch a spaceship with a BC arrival date, in the spaceship
dialog the "Year of arrival" is displayed as 2^16+arrival date.  The
game otherwise works as expected (apart from the fact that it's
reported as "Game: The Romans have launched a spaceship! It is
estimated to arrive on Alpha Centauri in -505", rather then in 
"505 BC").

This bug follows from a mismatch in put_int16/get_int16 of
pinfo->arrival_year for negative numbers.  Promoting them to int32
appears to correct the bug.  But I feel that all the present network
machinery does not handle cleanly signed int's: what happens with
machines having sizeof(int) > 32 ?  Maybe get_int16/get_int32 should
check the leftmost bit received, and propagate it further left if we
received less then sizeof(int) bits.

Regards,
        Massimo


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