Andrew Brown
Posts: 5007
Joined: 9/5/2000 From: Hex 82,170 Status: offline
|
quote:
ORIGINAL: Damien Thorn What changes were made to the Malaria zones? Once you posted the malaria code. Can you post the revised code so we can see the changes? Here is the snippet of code I sent to Mike Wood with the revised malaria zone and cold zone information. All I did was modify the piece of code that Mike originally posted. I am no programmer, so I hope that I didn't stuff it up. I am not sure if this suggested code was used as is, or modified again first, or whether Mike ignored my suggested code and just redid it from scratch. This will be the first thing I will test when the next update is available. I would also be happy for those who know C/C++ better than I do to verify that my suggested changes are OK.
//--------------------------------------------------------------------------------
bool MalariaZone(i16_t x, i16_t y, i16_t base)
{
bool answer=false;
// burma, malay, dutch indies
if(x<38 && y>25 && y<83)
answer=true;
// philpinnes, new guniea
else if(x>36 && x<51 && y>42 && y<83)
answer=true;
// south pacific
else if(x>50 && x<75 && y>79 && y<117)
answer=true;
// individual bases are
if(base==459 || base==455 || base==454 || base==458 || base==709) answer=true;
// individual bases are not
if(base==432 || base==484 || base==502 || base==445 || base==511
|| base==540 || base==614 || base==617 || base==688 || base==780) answer=false;
// city has drained swamps
if(gPlace[base].size>8) answer=false;
return(answer);
}
//--------------------------------------------------------------------------------
bool ColdZone(i16_t x, i16_t y, i16_t base)
{
bool answer=false;
// korea
if(x>56 && x<68 && y<40)
answer=true;
// siberia
else if(x>66 && x<89 && y<35)
answer=true;
// alaska and northern islands
else if(x>88 && x<131 && y<41)
answer=true;
// new zealand
else if(y>141)
answer=true;
// city has heaters
if(gPlace[base].size>8) answer=false;
return(answer);
}
// ----------------------------------------------------------------------------
bool ColdZoneN(i16_t x, i16_t y)
{
bool answer=false;
if(gScen.month>2 && gScen.month<11)
return SSI_FALSE;
// korea
if(x>56 && x<68 && y<40)
answer=true;
// siberia
else if(x>66 && x<89 && y<35)
answer=true;
// alaska and northern islands
else if(x>88 && x<131 && y<41)
answer=true;
return(answer);
}
// --------------------------------------------------------------------------------
bool ColdZoneS(i16_t x, i16_t y)
{
bool answer=false;
if(gScen.month<5 || gScen.month>8)
return SSI_FALSE;
// new zealand
if(x<70 && y>141)
answer=true;
return(answer);
}
Andrew
_____________________________
Information about my WitP map, and CHS, can be found on my WitP website
|