Advertisement
ZoriaRPG

COMBOTDM

Oct 2nd, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. case COMBOTDM:
  2.     {
  3.         int pos = (ri->d[0])/10000;
  4.         int sc = (ri->d[2]/10000);
  5.         int m = (ri->d[1]/10000)-1;
  6.         //int m = zc_max((ri->d[1]/10000)-1,0); //2.50.1 had this.
  7.     bool err_input_found;
  8.        
  9.     if ( m < 0 || m >= map_count ) {
  10.         al_trace("Invalid Map Reference Passed to Game->GetComboType: \n %d", m);
  11.         err_input_found = true;
  12.     }
  13.    
  14.     if ( sc < 0 || sc >= MAPSCRS )
  15.     {
  16.         al_trace("Invalid Screen Reference Passed to Screen->GetComboType: \n %d", sc);
  17.         err_input_found = true;
  18.     }
  19.    
  20.     if ( pos < 0 || pos > 175 )
  21.     {
  22.         al_trace("Invalid Position Reference Passed to Screen->GetComboype: \n %d", pos);
  23.         err_input_found = true;
  24.     }
  25.    
  26.     if ( err_input_found ) {
  27.         ret = -10000;
  28.     }
  29.        
  30.     else
  31.     {
  32.             long scr = m*MAPSCRS+sc;
  33.         //long scr = zc_max(m*MAPSCRS+sc,0); //2.50.1 had this.
  34.             int layr = whichlayer(scr);
  35.             if(scr==(currmap*MAPSCRS+currscr))
  36.                 ret=combobuf[tmpscr->data[pos]].type*10000;
  37.             else if(layr>-1)
  38.                 ret=combobuf[tmpscr2[layr].data[pos]].type*10000;
  39.             else ret=combobuf[
  40.                              TheMaps[scr].data[pos]].type*10000;
  41.     }
  42.  
  43.     }
  44.     break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement