Announcement

Collapse
No announcement yet.

Project: Messages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Project: Messages

    Several game messages are not called and some aspects of game play require some messages. this thread will addres thise hopefully easy fixes



    1) No warning when ceasefire broken
    2) Capture City triggers (we should add raze city)
    3) AI declared war



    and I'm sure there are more please input
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    For the first one
    1) No warning when ceasefire broken

    I have never seen it called but found this in the code.

    Code:
    void Player::BreakCeaseFire(PLAYER_INDEX other_player, BOOL sendMessages)
    {
    	if(g_network.IsClient() && g_network.IsLocalPlayer(m_owner)) {
    		g_network.SendAction(new NetAction(NET_ACTION_BREAK_CEASE_FIRE,
    										   m_owner, other_player, sendMessages));
    	} else if(g_network.IsHost()) {
    		g_network.Block(m_owner);
    		g_network.Enqueue(new NetInfo(NET_INFO_CODE_BREAK_CEASE_FIRE,
    									  m_owner, other_player, sendMessages));
    		g_network.Unblock(m_owner);
    	}
    
    	Agreement	a;
    
    	while ((a = FindAgreement(other_player)) != Agreement())
    	{
    		DPRINTF(k_DBG_INFO, ("Player #%d breaks an agreement with Player #%d\n", m_owner, other_player)) ;
    		a.Break();
    		g_slicEngine->RunTreatyBrokenTriggers(m_owner, other_player, a);
    		a.KillAgreement() ;										
    		m_broken_alliances_and_cease_fires++;
    
    		if(sendMessages) {
    			sendMessages = FALSE;
    			SlicObject *so = new SlicObject("108YouBrokeCeaseFire");
    			so->AddRecipient(m_owner);
    			so->AddCivilisation(other_player);
    			g_slicEngine->Execute(so);
    
    			so = new SlicObject("109CeaseFireBroken");
    			so->AddRecipient(other_player);
    			so->AddCivilisation(m_owner);
    			g_slicEngine->Execute(so);
    		}
    
            SetDiplomaticState(other_player, DIPLOMATIC_STATE_WAR); 
    		Assert(g_player[other_player]);
    		if (g_player[other_player]) {
    			
    			g_player[other_player]->SetDiplomaticState(m_owner, DIPLOMATIC_STATE_WAR);
    		}
    	}
    }
    can anyone verify not ever hearing of ceasefire broken? I'll keep digging, buthas any other coder seen how this hooks into game play?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment

    Working...
    X