ZoriaRPG

LoadMapData (sanity checks)

Oct 23rd, 2018
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. long FFScript::loadMapData()
  2. {
  3.     long _map = (ri->d[0] / 10000);
  4.     long _scr = (ri->d[1]/10000);
  5.     int indx = (zc_max((_map)-1,0) * MAPSCRS + _scr);
  6.     //Z_scripterrlog("LoadMapData Map Value: %d\n", _map);
  7.     //Z_scripterrlog("LoadMapData Screen Value: %d\n", _scr);
  8.     //Z_scripterrlog("LoadMapData Indx Value: %d\n", indx);
  9.      if ( _map < 1 || _map > (map_count-1) )
  10.     {
  11.     Z_scripterrlog("Invalid Map ID passed to Game->LoadMapData: %d\n", _map);
  12.     ri->mapsref = LONG_MAX;
  13.     }
  14.     else if ( _scr < 0 || _scr > 129 ) //0x00 to 0x81 -Z
  15.     {
  16.     Z_scripterrlog("Invalid Screen ID passed to Game->LoadMapData: %d\n", _scr);
  17.     ri->mapsref = LONG_MAX;
  18.     }
  19.     else ri->mapsref = indx;
  20.     //Z_scripterrlog("LoadMapData Screen set ri->mapsref to: %d\n", ri->mapsref);
  21.     return ri->mapsref;
  22. }
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.

×