Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //mapdata m-> Variables
- #define SET_MAPDATA_VAR_INT32(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member = vbound((value / 10000),-214747,214747); \
- } \
- } \
- #define SET_MAPDATA_VAR_INT16(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member = vbound((value / 10000),0,32767); \
- } \
- } \
- #define SET_MAPDATA_VAR_BYTE(member, str) \
- { \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member = vbound((value / 10000),0,255); \
- } \
- } \
- #define SET_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); \
- break; \
- } \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member[indx] = vbound((value / 10000),-214747,214747); \
- } \
- } \
- #define SET_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); \
- break; \
- } \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member[indx] = vbound((value / 10000),-32767,32767); \
- } \
- } \
- #define SET_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); \
- break; \
- } \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member[indx] = vbound((value / 10000),0,255); \
- } \
- }\
- #define SET_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); \
- break; \
- } \
- if ( ri->mapsref == 0 ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s pointer that is uninitialised\n",str); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- m->member[indx] =( (value/10000) ? 1 : 0 ); \
- } \
- } \
- #define SET_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); \
- break; \
- } \
- else if ( ri->mapsref == LONG_MAX ) \
- { \
- Z_scripterrlog("Script attempted to use a mapdata->%s on a pointer that is uninitialised\n",str); \
- break; \
- } \
- else \
- { \
- mapscr *m = &TheMaps[ri->mapsref]; \
- if ( flag != 0 ) \
- { \
- m->member|=flag; \
- } \
- else m->.member|= ~flag; \
- } \
- } \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement