For freeciv server I am trying to construct a line of code to check an if(condition), but cannot figure out how.
Here is the pseudo-code for what I'm trying:
if ( (tile_get_known(ptile, pplayer) == TILE_KNOWN_UNSEEN)
&& (player_thinks_there_is_a_nonallied_city_on_the_fogged_tile(pplayer,ptile) ) {
/* stuff goes here */
}
How would I do the "player_believes_there_is_a_nonallied_city_on_the_fogged_tile(pplayer,ptile)" ?
In other words, how do I check if a player sees a non-allied city on a fogged tile. This can be a different truth value from whether there actually is a non-allied city there, because on a fog-of-war tile, maybe the city was destroyed, disbanded, or conquered by an ally who doesn't share vision.
Thank you in advance if you know the answer. I think it has something to do with map_get_player_city() but can't figure it out.
Cheers
Server coding question. Please help!
Re: Server coding question. Please help!
Should be as easy as checking if the returned vision_site is a city (I guess you have to check "identity > 0", as there's no API for that), and owned ( vision_site_owner() ) by someone non-allied.
Re: Server coding question. Please help!
Thank you for quick response!!
- TharmonArace
- Posts: 3
- Joined: Thu Mar 09, 2023 8:35 pm
Re: Server coding question. Please help!
First off, I have to say that niche online marketplaces are like the secret sauce for us fans of specific genres or hobbies. There's something special about a tight-knit community coming together to share the love for their favorite games or interests.