Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///----------------------------------------------------------------------------------------------------//
- //mapdata m-> variables
- #define GET_MAPDATA_VAR_INT32(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member *10000); \
- } \
- } \
- #define GET_MAPDATA_VAR_INT16(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member *10000); \
- } \
- } \
- #define GET_MAPDATA_VAR_BYTE(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member *10000); \
- } \
- } \
- #define GET_MAPDATA_VAR_INDEX32(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- if(indx < 0 || indx > indexbound ) \
- { \
- Z_scripterrlog("Invalid Index passed to mapdata->%s[]: %d\n", (indx), str); \
- ret = -10000; \
- } \
- else \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member[indx] *10000); \
- } \
- } \
- } \
- #define GET_MAPDATA_VAR_INDEX16(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- if(indx < 0 || indx > indexbound ) \
- { \
- Z_scripterrlog("Invalid Index passed to mapdata->%s[]: %d\n", (indx), str); \
- ret = -10000; \
- } \
- else \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member[indx] *10000); \
- } \
- } \
- } \
- #define GET_MAPDATA_BYTE_INDEX(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- if(indx < 0 || indx > indexbound ) \
- { \
- Z_scripterrlog("Invalid Index passed to mapdata->%s[]: %d\n", (indx), str); \
- ret = -10000; \
- } \
- else \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member[indx] *10000); \
- } \
- } \
- } \
- /*
- #define GET_MAPDATA_LAYER_INDEX(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- mapscr *m = &TheMaps[ri->mapsref]; \
- if ( indx == 0 ) \
- { \
- \
- } \
- else \
- { \
- ret = (m->member[indx-1] *10000); \
- } \
- } \
- */
- #define GET_MAPDATA_LAYER_INDEX(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- if(indx < 0 || indx > indexbound ) \
- { \
- Z_scripterrlog("Invalid Index passed to mapdata->%s[]: %d\n", (indx), str); \
- ret = -10000; \
- } \
- else \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member[indx] *10000); \
- } \
- } \
- } \
- #define GET_MAPDATA_BOOL_INDEX(member, str, indexbound) \
- { \
- int indx = ri->d[0] / 10000; \
- if(indx < 0 || indx > indexbound ) \
- { \
- Z_scripterrlog("Invalid Index passed to mapdata->%s[]: %d\n", (indx), str); \
- ret = -10000; \
- } \
- else \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member[indx]?10000:0); \
- } \
- } \
- } \
- #define GET_MAPDATA_FLAG(member, str) \
- { \
- long flag = (value/10000); \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- ret = (m->member&flag) ? 10000 : 0); \
- } \
- } \
- #define GET_SCREENDATA_COMBO_VAR(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- int pos = ri->d[0] / 10000; \
- if(BC::checkComboPos(pos, str) != SH::_NoError) \
- ret = -10000; \
- else \
- ret = m->member[pos]*10000; \
- } \
- } \
- #define GET_MAPDATA_COMBO_VAR_BUF(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- ret = -10000; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- int pos = ri->d[0] / 10000; \
- if(BC::checkComboPos(pos, str) != SH::_NoError) \
- ret = -10000; \
- else \
- ret = combobuf[m->data[pos]].member * 10000; \
- } \
- } \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement