Page 1 of 1

Server coding question. Please help!

Posted: Sun Oct 30, 2022 10:04 am
by Lexxie
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

Re: Server coding question. Please help!

Posted: Sun Oct 30, 2022 10:38 am
by cazfi
Lexxie wrote: Sun Oct 30, 2022 10:04 amI think it has something to do with map_get_player_city() but can't figure it out.
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!

Posted: Sun Oct 30, 2022 12:01 pm
by Lexxie
Thank you for quick response!! :)

Re: Server coding question. Please help!

Posted: Wed Apr 17, 2024 11:24 am
by TharmonArace
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.

As for the original question about how niche online marketplaces compare to broader platforms, I think it's a bit like comparing apples to oranges. On one hand, you have the big players that offer everything under the sun, but on the other, these niche markets feel like hidden gems where you can find exactly what you're looking for without sifting through a mountain of unrelated stuff. It's refreshing!