ZoriaRPG

Mapdata Setter Routines (sanity checks)

Oct 23rd, 2018
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. case MAPDATAVALID:      SET_MAPDATA_VAR_BYTE(valid, "Valid"); break;        //b
  2. case MAPDATAGUY:        SET_MAPDATA_VAR_BYTE(guy, "Guy"); break;        //b
  3. case MAPDATASTRING:     SET_MAPDATA_VAR_INT32(str, "String"); break;        //w
  4. case MAPDATAROOM:       SET_MAPDATA_VAR_BYTE(room, "RoomType"); break;      //b
  5. case MAPDATAITEM:       SET_MAPDATA_VAR_BYTE(item, "Item"); break;      //b
  6. case MAPDATAHASITEM:        SET_MAPDATA_VAR_BYTE(hasitem, "HasItem"); break;    //b
  7. case MAPDATATILEWARPTYPE:   SET_MAPDATA_BYTE_INDEX(tilewarptype, "TileWarpType", 3); break; //b, 4 of these
  8. case MAPDATATILEWARPOVFLAGS:    SET_MAPDATA_VAR_BYTE(tilewarpoverlayflags, "TileWarpOverlayFlags"); break;  //b, tilewarpoverlayflags
  9. case MAPDATADOORCOMBOSET:   SET_MAPDATA_VAR_INT32(door_combo_set, "DoorComboSet"); break;   //w
  10. case MAPDATAWARPRETX:       SET_MAPDATA_BYTE_INDEX(warpreturnx, "WarpReturnX", 3); break;   //b, 4 of these
  11. case MAPDATAWARPRETY:       SET_MAPDATA_BYTE_INDEX(warpreturny, "WarpReturnY", 3); break;   //b, 4 of these
  12. case MAPDATAWARPRETURNC:    SET_MAPDATA_VAR_INT32(warpreturnc, "WarpReturnC"); break;   //w
  13. case MAPDATASTAIRX:         SET_MAPDATA_VAR_BYTE(stairx, "StairsX"); break; //b
  14. case MAPDATASTAIRY:         SET_MAPDATA_VAR_BYTE(stairy, "StairsY"); break; //b
  15. case MAPDATAITEMX:      SET_MAPDATA_VAR_BYTE(itemx, "ItemX"); break; //itemx
  16. case MAPDATAITEMY:      SET_MAPDATA_VAR_BYTE(itemy, "ItemY"); break;    //itemy
  17. case MAPDATACOLOUR:         SET_MAPDATA_VAR_INT32(color, "CSet"); break;    //w
  18. case MAPDATAENEMYFLAGS:     SET_MAPDATA_VAR_BYTE(enemyflags, "EnemyFlags"); break;  //b
  19. case MAPDATADOOR:       SET_MAPDATA_BYTE_INDEX(door, "Door", 3); break; //b, 4 of these
  20. case MAPDATATILEWARPDMAP:   SET_MAPDATA_VAR_INDEX32(tilewarpdmap, "TileWarpDMap", 3); break;    //w, 4 of these
  21. case MAPDATATILEWARPSCREEN:     SET_MAPDATA_BYTE_INDEX(tilewarpscr, "TileWarpScreen", 3); break;    //b, 4 of these
  22. case MAPDATAEXITDIR:        SET_MAPDATA_VAR_BYTE(exitdir, "ExitDir"); break;    //b
  23. case MAPDATAENEMY:      SET_MAPDATA_VAR_INDEX32(enemy, "Enemy", 9); break;  //w, 10 of these
  24. case MAPDATAPATTERN:        SET_MAPDATA_VAR_BYTE(pattern, "Pattern"); break;    //b
  25. case MAPDATASIDEWARPTYPE:   SET_MAPDATA_BYTE_INDEX(sidewarptype, "SideWarpType", 3); break; //b, 4 of these
  26. case MAPDATASIDEWARPOVFLAGS:    SET_MAPDATA_VAR_BYTE(sidewarpoverlayflags, "SideWarpOverlayFlags"); break;  //b
  27. case MAPDATAWARPARRIVALX:   SET_MAPDATA_VAR_BYTE(warparrivalx, "WarpArrivalX"); break;  //b
  28. case MAPDATAWARPARRIVALY:   SET_MAPDATA_VAR_BYTE(warparrivaly, "WarpArrivalY"); break;  //b
  29. case MAPDATAPATH:       SET_MAPDATA_BYTE_INDEX(path, "MazePath", 3); break; //b, 4 of these
  30. case MAPDATASIDEWARPSC:     SET_MAPDATA_BYTE_INDEX(sidewarpscr, "SideWarpScreen", 3); break;    //b, 4 of these
  31. case MAPDATASIDEWARPDMAP:   SET_MAPDATA_VAR_INDEX32(sidewarpdmap, "SideWarpDMap", 3); break;    //w, 4 of these
  32. case MAPDATASIDEWARPINDEX:  SET_MAPDATA_VAR_BYTE(sidewarpindex, "SideWarpIndex"); break;    //b
  33. case MAPDATAUNDERCOMBO:     SET_MAPDATA_VAR_INT32(undercombo, "Undercombo"); break; //w
  34. case MAPDATAUNDERCSET:      SET_MAPDATA_VAR_BYTE(undercset, "UnderCSet"); break; //b
  35. case MAPDATACATCHALL:       SET_MAPDATA_VAR_INT32(catchall, "Catchall"); break; //W
  36.  
  37. case MAPDATACSENSITIVE:     SET_MAPDATA_VAR_BYTE(csensitive, "CSensitive"); break;  //B
  38. case MAPDATANORESET:        SET_MAPDATA_VAR_INT32(noreset, "NoReset"); break;   //W
  39. case MAPDATANOCARRY:        SET_MAPDATA_VAR_INT32(nocarry, "NoCarry"); break;   //W
  40. //! Layer arrays should be a size of 7, and return the current screen / map / and OP_OPAQUE
  41. //! if you try to read 0, so that they correspond to actual layer IDs.
  42. //!
  43. case MAPDATALAYERMAP:       SET_MAPDATA_BYTE_INDEX(layermap, "LayerMap", 5); break; //B, 6 OF THESE
  44. case MAPDATALAYERSCREEN:    SET_MAPDATA_BYTE_INDEX(layerscreen, "LayerScreen", 5); break;   //B, 6 OF THESE
  45. case MAPDATALAYEROPACITY:   SET_MAPDATA_BYTE_INDEX(layeropacity, "LayerOpacity", 5); break; //B, 6 OF THESE
  46. case MAPDATATIMEDWARPTICS:  SET_MAPDATA_VAR_INT32(timedwarptics, "TimedWarpTimer"); break;  //W
  47. case MAPDATANEXTMAP:        SET_MAPDATA_VAR_BYTE(nextmap, "NextMap"); break;    //B
  48. case MAPDATANEXTSCREEN:     SET_MAPDATA_VAR_BYTE(nextscr, "NextScreen"); break; //B
  49. case MAPDATASECRETCOMBO:    SET_MAPDATA_VAR_INDEX32(secretcombo, "SecretCombo", 127); break;    //W, 128 OF THESE
  50. case MAPDATASECRETCSET:     SET_MAPDATA_BYTE_INDEX(secretcset, "SecretCSet", 127); break;   //B, 128 OF THESE
  51. case MAPDATASECRETFLAG:     SET_MAPDATA_BYTE_INDEX(secretflag, "SecretFlags", 127); break;  //B, 128 OF THESE
  52. case MAPDATAVIEWX:      SET_MAPDATA_VAR_INT32(viewX, "ViewX"); break;   //W
  53. case MAPDATAVIEWY:      SET_MAPDATA_VAR_INT32(viewY, "ViewY"); break; //W
  54. case MAPDATASCREENWIDTH:    SET_MAPDATA_VAR_BYTE(scrWidth, "Width"); break; //B
  55. case MAPDATASCREENHEIGHT:   SET_MAPDATA_VAR_BYTE(scrHeight, "Height"); break;   //B
  56. case MAPDATAENTRYX:         SET_MAPDATA_VAR_BYTE(entry_x, "EntryX"); break; //B
  57. case MAPDATAENTRYY:         SET_MAPDATA_VAR_BYTE(entry_y, "EntryY"); break; //B
  58. case MAPDATANUMFF:      SET_MAPDATA_VAR_INT16(numff, "NumFFCs"); break; //INT16
  59. case MAPDATAFFDATA:         SET_MAPDATA_VAR_INDEX32(ffdata, "FFCData", 31); break;  //W, 32 OF THESE
  60. case MAPDATAFFCSET:         SET_MAPDATA_BYTE_INDEX(ffcset,  "FFCCSet", 31); break;  //B, 32
  61. case MAPDATAFFDELAY:        SET_MAPDATA_VAR_INDEX32(ffdelay, "FFCDelay", 31); break;    //W, 32
  62. case MAPDATAFFX:        SET_MAPDATA_VAR_INDEX32(ffx, "FFCX", 31); break;    //INT32, 32 OF THESE
  63. case MAPDATAFFY:        SET_MAPDATA_VAR_INDEX32(ffy, "FFCY", 31); break;    //..
  64. case MAPDATAFFXDELTA:       SET_MAPDATA_VAR_INDEX32(ffxdelta, "FFCVx", 31); break;  //..
  65. case MAPDATAFFYDELTA:       SET_MAPDATA_VAR_INDEX32(ffydelta, "FFCVy", 31); break;  //..
  66. case MAPDATAFFXDELTA2:      SET_MAPDATA_VAR_INDEX32(ffxdelta2, "FFCAx", 31); break; //..
  67. case MAPDATAFFYDELTA2:      SET_MAPDATA_VAR_INDEX32(ffydelta2, "FFCAy", 31); break; //..
  68. case MAPDATAFFFLAGS:        SET_MAPDATA_VAR_INDEX16(ffflags, "FFCFlags", 31); break;    //INT16, 32 OF THESE
  69. //Height and With are Or'd together, and need to be separate:
  70. /*
  71.  //TileWidth ffwidth[ri->ffcref]= (tmpscr->ffwidth[ri->ffcref] & ~63) | (((value/10000)-1)&63);
  72. */
  73. case MAPDATAFFWIDTH:       
  74. {
  75.    
  76.     int indx = ri->d[0] / 10000;
  77.     if ( indx < 0 || indx > 31 )
  78.     {
  79.         Z_scripterrlog("Invalid FFC Index passed to MapData->FFCTileWidth[]: %d\n", indx);
  80.         break;
  81.     }
  82.     if ( (value/10000) < 0 || (value/10000) > 4 )
  83.     {
  84.         Z_scripterrlog("Invalid WIDTH value passed to MapData->FFCTileWidth[]: %d\n", value);
  85.         break;
  86.     }
  87.    
  88.    
  89.     if ( ri->mapsref == 0 )
  90.     {
  91.         Z_scripterrlog("Script attempted to use MapData->FFCTileWidth[] on a pointer that is uninitialised\n",str);
  92.         break
  93.     }
  94.     else if ( ri->mapsref == LONG_MAX )
  95.     {
  96.         Z_scripterrlog("Script attempted to use MapData->FFCTileWidth[] on a pointer that is invalid\n",str);
  97.         break;
  98.     }
  99.     else
  100.     {
  101.         mapscr *m = &TheMaps[ri->mapsref];
  102.         m->ffwidth[indx] = ( m->ffwidth[indx]&~63) | vbound( (((value/10000)-1)&63), (0&63), (214747&63) );
  103.     }  
  104.     break;
  105. }  
  106.  
  107.  
  108. //SET_MAPDATA_BYTE_INDEX(ffwidth, "FFCTileWidth");  //B, 32 OF THESE
  109. case MAPDATAFFHEIGHT:      
  110. {
  111.     int indx = ri->d[0] / 10000;
  112.     if ( indx < 0 || indx > 31 )
  113.     {
  114.         Z_scripterrlog("Invalid FFC Index passed to MapData->FFCTileHeight[]: %d\n", indx);
  115.         break;
  116.     }
  117.     if ( (value/10000) < 0 || (value/10000) > 4 )
  118.     {
  119.         Z_scripterrlog("Invalid WIDTH value passed to MapData->FFCTileHeight[]: %d\n", value);
  120.         break;
  121.     }
  122.     if ( ri->mapsref == 0 )
  123.     {
  124.         Z_scripterrlog("Script attempted to use MapData->FFCTileHeight[] on a pointer that is uninitialised\n",str);
  125.         break
  126.     }
  127.     else if ( ri->mapsref == LONG_MAX )
  128.     {
  129.         Z_scripterrlog("Script attempted to use MapData->FFCTileHeight[] on a pointer that is invalid\n",str);
  130.         break;
  131.     }
  132.     else
  133.     {
  134.         mapscr *m = &TheMaps[ri->mapsref];
  135.         m->ffheight[indx] = ( m->ffheight[indx]&~63) | vbound( (((value/10000)-1)&63), (0&63), (4&63) );
  136.     }
  137.    
  138.     break;
  139.    
  140. }
  141.  
  142. //EffectWidth tmpscr->ffwidth[ri->ffcref]= (tmpscr->ffwidth[ri->ffcref]&63) | ((((value/10000)-1)&3)<<6);
  143.  
  144. //SET_MAPDATA_BYTE_INDEX(ffheight, "FFCTileHeight"  //B, 32 OF THESE
  145. case MAPDATAFFEFFECTWIDTH:     
  146. {
  147.     mapscr *m = &TheMaps[ri->mapsref];
  148.     int indx = ri->d[0] / 10000;
  149.     if ( indx < 0 || indx > 31 )
  150.     {
  151.         Z_scripterrlog("Invalid FFC Index passed to MapData->FFCEffectWidth[]: %d\n", indx);
  152.         break;
  153.     }
  154.     if ( (value/10000) < 0 )
  155.     {
  156.         Z_scripterrlog("Invalid WIDTH value passed to MapData->FFCEffectWidth[]: %d\n", value);
  157.         break;
  158.     }
  159.     if ( ri->mapsref == 0 )
  160.     {
  161.         Z_scripterrlog("Script attempted to use MapData->FFCEffectWidth[] on a pointer that is uninitialised\n",str);
  162.         break
  163.     }
  164.     else if ( ri->mapsref == LONG_MAX )
  165.     {
  166.         Z_scripterrlog("Script attempted to use MapData->FFCEffectWidth[] on a pointer that is invalid\n",str);
  167.         break;
  168.     }
  169.     else
  170.     {
  171.         mapscr *m = &TheMaps[ri->mapsref];
  172.         m->ffwidth[indx] = ( m->ffwidth[indx]&63) | vbound( ((((value/10000)-1)&3)<<6), ((((0)-1)&3)<<6), ((((214747)&3)<<6)) );
  173.     }
  174.    
  175.     break;
  176. }
  177.  
  178.  
  179. //SET_MAPDATA_BYTE_INDEX(ffwidth, "FFCEffectWidth");    //B, 32 OF THESE
  180. case MAPDATAFFEFFECTHEIGHT:
  181. {
  182.     mapscr *m = &TheMaps[ri->mapsref];
  183.     int indx = ri->d[0] / 10000;
  184.     if ( indx < 0 || indx > 31 )
  185.     {
  186.         Z_scripterrlog("Invalid FFC Index passed to MapData->FFCEffectHeight[]: %d\n", indx);
  187.         break;
  188.     }
  189.     if ( (value/10000) < 0 )
  190.     {
  191.         Z_scripterrlog("Invalid HEIGHT value passed to MapData->FFCEffectHeight[]: %d\n", value);
  192.         break;
  193.     }
  194.     if ( ri->mapsref == 0 )
  195.     {
  196.         Z_scripterrlog("Script attempted to use MapData->FFCEffectHeight[] on a pointer that is uninitialised\n",str);
  197.         break
  198.     }
  199.     else if ( ri->mapsref == LONG_MAX )
  200.     {
  201.         Z_scripterrlog("Script attempted to use MapData->FFCEffectHeight[] on a pointer that is invalid\n",str);
  202.         break;
  203.     }
  204.     else
  205.     {
  206.         mapscr *m = &TheMaps[ri->mapsref];
  207.         m->ffheight[indx] = ( m->ffheight[indx]&63) | vbound( ((((value/10000)-1)&3)<<6), ((((0)-1)&3)<<6), ((((214747)&3)<<6)) );
  208.     }
  209.     break;
  210. }  
  211.    
  212. //SET_MAPDATA_BYTE_INDEX(ffheight, "FFCEffectHeight"    //B, 32 OF THESE   
  213.  
  214. case MAPDATAFFLINK:         SET_MAPDATA_BYTE_INDEX(fflink, "FFCLink", 31); break;   //B, 32 OF THESE
  215. case MAPDATAFFSCRIPT:       SET_MAPDATA_VAR_INDEX32(ffscript, "FFCScript", 31); break;  //W, 32 OF THESE
  216.  
  217. case MAPDATAINTID:   //Same form as SetScreenD()
  218.     //SetFFCInitD(ffindex, d, value)
  219. {
  220.     if ( ri->mapsref == 0 )
  221.     {
  222.         Z_scripterrlog("Script attempted to use MapData->InitD[] on a pointer that is uninitialised\n",str);
  223.         break
  224.     }
  225.     else if ( ri->mapsref == LONG_MAX )
  226.     {
  227.         Z_scripterrlog("Script attempted to use MapData->InitD[] on a pointer that is invalid\n",str);
  228.         break;
  229.     }
  230.     else
  231.     {
  232.         mapscr *m = &TheMaps[ri->mapsref];
  233.         //int ffindex = ri->d[0]/10000;
  234.         //int d = ri->d[1]/10000;
  235.         //int v = (value/10000);
  236.         m->initd[(ri->d[0]/10000)][(ri->d[1]/10000)] = (value/10000);
  237.     }
  238.    
  239.     break;
  240. }  
  241.    
  242.  
  243. //initd //INT32 , 32 OF THESE, EACH WITH 10 INDICES.
  244.  
  245.  
  246. case MAPDATAINITA:     
  247.     //same form as SetScreenD
  248. {
  249.     if ( ri->mapsref == 0 )
  250.     {
  251.         Z_scripterrlog("Script attempted to use MapData->InitA[] on a pointer that is uninitialised\n",str);
  252.         break
  253.     }
  254.     else if ( ri->mapsref == LONG_MAX )
  255.     {
  256.         Z_scripterrlog("Script attempted to use MapData->InitA[] on a pointer that is invalid\n",str);
  257.         break;
  258.     }
  259.     else
  260.     {
  261.         mapscr *m = &TheMaps[ri->mapsref];
  262.         //int ffindex = ri->d[0]/10000;
  263.         //int d = ri->d[1]/10000;
  264.         //int v = (value/10000);
  265.         m->inita[(ri->d[0]/10000)][(ri->d[1]/10000)] = (value/10000);
  266.     }
  267.     break;
  268. }  
  269.    
  270. case MAPDATAFFINITIALISED:  SET_MAPDATA_BOOL_INDEX(initialized, "FFCRunning", 31); break;   //BOOL, 32 OF THESE
  271. case MAPDATASCRIPTENTRY:    SET_MAPDATA_VAR_INT32(script_entry, "ScriptEntry"); break;  //W
  272. case MAPDATASCRIPTOCCUPANCY:    SET_MAPDATA_VAR_INT32(script_occupancy, "ScriptOccupancy");  break;//W
  273. case MAPDATASCRIPTEXIT:     SET_MAPDATA_VAR_INT32(script_exit, "ExitScript"); break;    //W
  274. case MAPDATAOCEANSFX:       SET_MAPDATA_VAR_BYTE(oceansfx, "OceanSFX"); break;  //B
  275. case MAPDATABOSSSFX:        SET_MAPDATA_VAR_BYTE(bosssfx, "BossSFX"); break;    //B
  276. case MAPDATASECRETSFX:      SET_MAPDATA_VAR_BYTE(secretsfx, "SecretSFX"); break;    //B
  277. case MAPDATAHOLDUPSFX:      SET_MAPDATA_VAR_BYTE(holdupsfx, "ItemSFX"); break; //B
  278. case MAPDATASCREENMIDI:     SET_MAPDATA_VAR_INT16(screen_midi, "MIDI"); break;  //SHORT, OLD QUESTS ONLY?
  279. case MAPDATALENSLAYER:      SET_MAPDATA_VAR_BYTE(lens_layer, "LensLayer"); break;   //B, OLD QUESTS ONLY?
  280.    
  281.  
  282. case MAPDATAFLAGS:
  283. {
  284.     if ( ri->mapsref == 0 )
  285.     {
  286.         Z_scripterrlog("Script attempted to use MapData->Flags[] on a pointer that is uninitialised\n",str);
  287.         break
  288.     }
  289.     else if ( ri->mapsref == LONG_MAX )
  290.     {
  291.         Z_scripterrlog("Script attempted to use MapData->Flags[] on a pointer that is invalid\n",str);
  292.         break;
  293.     }
  294.     else
  295.     {
  296.         mapscr *m = &TheMaps[ri->mapsref];
  297.         int flagid = (ri->d[0])/10000;
  298.    
  299.         //bool valtrue = ( value ? 10000 : 0);
  300.         switch(flagid)
  301.         {
  302.             case 0: m->flags = (value / 10000); break;
  303.             case 1: m->flags2 = (value / 10000); break;
  304.             case 2: m->flags3 = (value / 10000); break;
  305.             case 3: m->flags4 = (value / 10000); break;
  306.             case 4: m->flags5 = (value / 10000); break;
  307.             case 5: m->flags6 = (value / 10000); break;
  308.             case 6: m->flags7 = (value / 10000); break;
  309.             case 7: m->flags8 = (value / 10000); break;
  310.             case 8: m->flags9 = (value / 10000); break;
  311.             case 9: m->flags10 = (value / 10000); break;
  312.             default:
  313.             {
  314.                 Z_scripterrlog("Invalid index passed to mapdata->flags[]: %d\n", flagid);
  315.                 break;
  316.                
  317.             }
  318.         }
  319.     }
  320.     break;
  321.    
  322.     //SET_MAPDATA_BYTE_INDEX    //B, 11 OF THESE, flags, flags2-flags10
  323. }
  324.  
  325. case MAPDATAMISCD:
  326. {
  327.     int indx = (ri->d[0])/10000;
  328.     if(indx < 0 || indx > 7)
  329.     {
  330.         Z_scripterrlog("You were trying to reference an out-of-bounds array index for a screen's D[] array (%ld); valid indices are from 0 to 7.\n", indx);
  331.         break;
  332.     }
  333.     else
  334.     {
  335.         if ( ri->mapsref == 0 )
  336.         {
  337.             Z_scripterrlog("Script attempted to use MapData->MiscD[] on a pointer that is uninitialised\n",str);
  338.             break
  339.         }
  340.         else if ( ri->mapsref == LONG_MAX )
  341.         {
  342.             Z_scripterrlog("Script attempted to use MapData->MiscD[] on a pointer that is invalid\n",str);
  343.             break;
  344.         }
  345.         else
  346.         {
  347.             mapscr *m = &TheMaps[ri->mapsref];
  348.             //int ffindex = ri->d[0]/10000;
  349.             //int d = ri->d[1]/10000;
  350.             //int v = (value/10000);
  351.             game->screen_d[ri->mapsref][indx] = value/10000;
  352.         }
  353.        
  354.         break;
  355.     }
  356. }
  357.  
  358.  
  359.   case MAPDATACOMBODD:
  360.     {
  361.         int pos = (ri->d[0])/10000;
  362.         if(pos >= 0 && pos < 176)
  363.         {
  364.         if ( ri->mapsref == 0 )
  365.         {
  366.             Z_scripterrlog("Script attempted to use MapData->ComboD[] on a pointer that is uninitialised\n",str);
  367.             break
  368.         }
  369.         else if ( ri->mapsref == LONG_MAX )
  370.         {
  371.             Z_scripterrlog("Script attempted to use MapData->ComboD[] on a pointer that is invalid\n",str);
  372.             break;
  373.         }
  374.         else
  375.         {
  376.             mapscr *m = &TheMaps[ri->mapsref];
  377.             screen_combo_modify_preroutine(m,pos);
  378.             m->data[pos]=(value/10000);
  379.             screen_combo_modify_postroutine(m,pos);
  380.         }
  381.         }
  382.     }
  383.     break;
  384.    
  385.     case MAPDATACOMBOCD:
  386.     {
  387.         int pos = (ri->d[0])/10000;
  388.         if(pos >= 0 && pos < 176)
  389.         {
  390.         if ( ri->mapsref == 0 )
  391.         {
  392.             Z_scripterrlog("Script attempted to use MapData->ComboD[] on a pointer that is uninitialised\n",str);
  393.             break
  394.         }
  395.         else if ( ri->mapsref == LONG_MAX )
  396.         {
  397.             Z_scripterrlog("Script attempted to use MapData->ComboD[] on a pointer that is invalid\n",str);
  398.             break;
  399.         }
  400.         else
  401.         {
  402.             mapscr *m = &TheMaps[ri->mapsref];
  403.             screen_combo_modify_preroutine(m,pos);
  404.             m->cset[pos]=(value/10000)&15;
  405.             screen_combo_modify_postroutine(m,pos);
  406.         }
  407.         }
  408.     }
  409.     break;
  410.    
  411.     case MAPDATACOMBOFD:
  412.     {
  413.         int pos = (ri->d[0])/10000;
  414.         if(pos >= 0 && pos < 176)
  415.     {
  416.         if ( ri->mapsref == 0 )
  417.         {
  418.             Z_scripterrlog("Script attempted to use MapData->ComboF[] on a pointer that is uninitialised\n",str);
  419.             break
  420.         }
  421.         else if ( ri->mapsref == LONG_MAX )
  422.         {
  423.             Z_scripterrlog("Script attempted to use MapData->ComboF[] on a pointer that is invalid\n",str);
  424.             break;
  425.         }
  426.         else
  427.         {
  428.             mapscr *m = &TheMaps[ri->mapsref];
  429.             m->sflag[pos]=(value/10000);
  430.         }
  431.     }
  432.     }
  433.     break;
  434.    
  435.     case MAPDATACOMBOTD:
  436.     {
  437.         int pos = (ri->d[0])/10000;
  438.         if(pos >= 0 && pos < 176)
  439.         {
  440.         if ( ri->mapsref == 0 )
  441.         {
  442.             Z_scripterrlog("Script attempted to use MapData->ComboT[] on a pointer that is uninitialised\n",str);
  443.             break
  444.         }
  445.         else if ( ri->mapsref == LONG_MAX )
  446.         {
  447.             Z_scripterrlog("Script attempted to use MapData->ComboT[] on a pointer that is invalid\n",str);
  448.             break;
  449.         }
  450.         else
  451.         {
  452.             mapscr *m = &TheMaps[ri->mapsref];
  453.            
  454.             // Preprocess each instance of the combo on the screen
  455.             for(int i = 0; i < 176; i++)
  456.             {
  457.                 if(m->data[i] == m->data[pos])
  458.                 {
  459.                     screen_combo_modify_preroutine(m,i);
  460.                 }
  461.             }
  462.                
  463.             combobuf[m->data[pos]].type=value/10000;
  464.                
  465.             for(int i = 0; i < 176; i++)
  466.             {
  467.                 if(m->data[i] == m->data[pos])
  468.                 {
  469.                     screen_combo_modify_postroutine(m,i);
  470.                 }
  471.             }
  472.         }
  473.         }
  474.     }
  475.     break;
  476.    
  477.     case MAPDATACOMBOID:
  478.     {
  479.         int pos = (ri->d[0])/10000;
  480.         if(pos >= 0 && pos < 176)
  481.     {
  482.         if ( ri->mapsref == 0 )
  483.         {
  484.             Z_scripterrlog("Script attempted to use MapData->ComboI[] on a pointer that is uninitialised\n",str);
  485.             break
  486.         }
  487.         else if ( ri->mapsref == LONG_MAX )
  488.         {
  489.             Z_scripterrlog("Script attempted to use MapData->ComboI[] on a pointer that is invalid\n",str);
  490.             break;
  491.         }
  492.         else
  493.         {
  494.             mapscr *m = &TheMaps[ri->mapsref];
  495.             combobuf[m->data[pos]].flag=value/10000;
  496.         }
  497.     }
  498.     }
  499.     break;
  500.    
  501.     case MAPDATACOMBOSD:
  502.     {
  503.         int pos = (ri->d[0])/10000;
  504.         if(pos >= 0 && pos < 176)\
  505.     {
  506.         if ( ri->mapsref == 0 )
  507.         {
  508.             Z_scripterrlog("Script attempted to use MapData->ComboS[] on a pointer that is uninitialised\n",str);
  509.             break
  510.         }
  511.         else if ( ri->mapsref == LONG_MAX )
  512.         {
  513.             Z_scripterrlog("Script attempted to use MapData->ComboS[] on a pointer that is invalid\n",str);
  514.             break;
  515.         }
  516.         else
  517.         {
  518.             mapscr *m = &TheMaps[ri->mapsref];
  519.             combobuf[m->data[pos]].walk=(value/10000)&15;
  520.         }
  521.        
  522.        
  523.     }
  524.            
  525.     }
  526.     break;
  527.  
  528.     case MAPDATASCREENSTATED:
  529.     {
  530.         if ( ri->mapsref == 0 )
  531.         {
  532.             Z_scripterrlog("Script attempted to use MapData->ComboF[] on a pointer that is uninitialised\n",str);
  533.             break
  534.         }
  535.         else if ( ri->mapsref == LONG_MAX )
  536.         {
  537.             Z_scripterrlog("Script attempted to use MapData->ComboF[] on a pointer that is invalid\n",str);
  538.             break;
  539.         }
  540.         else
  541.         {
  542.             (value)?setmapflag(ri->mapsref, 1<<((ri->d[0])/10000)) : unsetmapflag(ri->mapsref, 1 << ((ri->d[0]) / 10000));
  543.    
  544.         }
  545.         }
  546.     break;
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×