X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=230f529995363fe10f8c762b7d9035b0333f7a0b;hb=3ba53b20d22013787479256bbf445a958ec8826f;hp=e5055eda6513d061b8f6eaab76c1922a3f4f6158;hpb=0cccb6d03df991d9c978ef3f7e16aadf3470a49b;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index e5055eda..230f5299 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2433,7 +2433,7 @@ int get_next_element(int element) } } -int el2gfx(int element) +int el2gfx_OLD(int element) { switch(element) { @@ -2714,3 +2714,22 @@ int el2gfx(int element) } } } + +int el2gfx(int element) +{ + int graphic_OLD = el2gfx_OLD(element); + int graphic_NEW = element_info[element].graphic; + + if (element >= MAX_ELEMENTS) + { + Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element); + } + + if (graphic_NEW != graphic_OLD) + { + Error(ERR_WARN, "el2gfx: graphic_NEW (%d) != graphic_OLD (%d)", + graphic_NEW, graphic_OLD); + } + + return graphic_NEW; +}