src/economy.cpp
branchNewGRF_ports
changeset 6877 889301acc299
parent 6872 1c4a4a609f85
child 6878 7d1ff2f621c7
equal deleted inserted replaced
6876:2c40faeef7a5 6877:889301acc299
  1869 
  1869 
  1870 	/* Cannot buy shares of non-existent nor bankrupted company */
  1870 	/* Cannot buy shares of non-existent nor bankrupted company */
  1871 	if (!p->is_active) return CMD_ERROR;
  1871 	if (!p->is_active) return CMD_ERROR;
  1872 
  1872 
  1873 	/* Protect new companies from hostile takeovers */
  1873 	/* Protect new companies from hostile takeovers */
  1874 	if (_cur_year - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED);
  1874 	if (_cur_year - p->inaugurated_year < 6) return_cmd_error(STR_PROTECTED);
  1875 
  1875 
  1876 	/* Those lines are here for network-protection (clients can be slow) */
  1876 	/* Those lines are here for network-protection (clients can be slow) */
  1877 	if (GetAmountOwnedBy(p, PLAYER_SPECTATOR) == 0) return cost;
  1877 	if (GetAmountOwnedBy(p, PLAYER_SPECTATOR) == 0) return cost;
  1878 
  1878 
  1879 	/* We can not buy out a real player (temporarily). TODO: well, enable it obviously */
  1879 	/* We can not buy out a real player (temporarily). TODO: well, enable it obviously */