User Tag List

Results 1 to 8 of 8

Thread: [Critical] Trying to set ComboS[] on layer 2 - ZC Terminates

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,765
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.76%
    Here is the codeblock:

    Code:
    if ( SWITCHHOOK_USE_LAYER_2 ) { //2
    	for ( int q = 0; q < 176; q++ ) { 	//Pass through the screen combos to find a match...
    		int cmb2 = GetLayerComboI(2,q); 	//loading them along the way...
    		cmb2X = ComboX(q);	//The combo number for the for loop pass...
    		cmb2Y = ComboY(q);	//... X and Y
    		int loc = ComboAt(cmb2X,cmb2Y);
    
    		if ( ( comboF && cmb2 == comboF ) || ( !comboF && cmb2 == CF_SWITCHHOOK ) ) { 	
    						//If D0 is assigned a value above 0, check to see if it matches
    						//that combo inherent flag, otherwise check if it matches the one
    						//assigned to the constant CF_SWITCHSHOT.
    			
    						//If it does....
    			//int cmb_under = 
    			
    			//if ( switching ) {
    			if ( ComboCollision(loc,l) ) {	//and there is collision between that combo and the hookshot...
    				
    			//!We need to check every layer...too..for combos on layers higher than 0. (?)
    				l->DeadState = WDS_DEAD;	//Kill the hookshot.
    				
    				if ( sfx ) Game->PlaySound(sfx); //Play the sound defined in the item script,
    				if ( !sfx && SFX_SWITCHHOOK ) Game->PlaySound(SFX_SWITCHHOOK);  //or the constant if the item editor arg isn't set.
    					
    				//Store Link's starting position.
    				lx = CenterLinkX();
    				ly = CenterLinkY();
    					
    				//Store the switchshot combo to move.
    				cmb2X = ComboX(q);	//The combo number for the for loop pass...
    				cmb2Y = ComboY(q);	//... X and Y
    				cmb2D = GetLayerComboD(2,q); //The original data of the switchhook combo.
    				cmb2S = GetLayerComboS(2,q); //The original solidity of the switchshot combo. 
    				cmb2C = GetLayerComboC(2,q); //The original CSet.
    				
    				//Store the combo datum for the cumbo that Link is on. 
    				
    				cmb2LD = GetLayerComboD(2,ComboAt(Link->X, Link->Y)); //The combo under Link.
    				cmb2LS = GetLayerComboS(2,ComboAt(Link->X, Link->Y)); //The solidity of the combo under Link.
    				cmb2LX = GridX(lx); //The X position
    				cmb2LY = GridY(ly); //The Y position
    				cmb2L = ComboAt(cmb2LX,cmb2LY); //The screen index for that combo (Nth of 276).
    				cmb2LC = GetLayerComboC(2,ComboAt(Link->X, Link->Y));
    				
    					
    				//Change the combo where Link WAS, to the switchshot combo.
    				SetLayerComboD(2,cmb2L,cmb2D); //Set its data
    				SetLayerComboS(2,cmb2L,cmb2S); //and solidity.
    				
    				//!Setting solidity on layer 2 crashes ZC....BUT
    				//!the solidity seems to be preserved anyway.
    				
    				SetLayerComboC(2,cmb2L,cmb2C); //and CSet.
    				
    				
    				//Move Link to where the old switchshot combo that we moved, WAS.
    				Link->X = cmb2X;
    				Link->Y = cmb2Y;
    				
    					
    				//Move the switchshot combo to where LINK was before he moved...
    				SetLayerComboD(2,q,cmb2LD); //Set the combo data
    				SetLayerComboS(2,q,cmb2LS); //and the solidity.
    				SetLayerComboC(2,q,cmb2LC); //and CSet.
    
    				
    				this->Script = 0; //Free the FFC for later use.
    				this->Data = 0;
    				Quit();
    			}
    		}
    	}
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social