1 | %{ |
1 | %{ |
2 | /* |
2 | /* |
3 | * static char *rcsid_object_c = |
3 | * static char *rcsid_object_c = |
4 | * "$Id: loader.l,v 1.1.1.2 2006/02/22 18:01:20 elmex Exp $"; |
4 | * "$Id: loader.l,v 1.1.1.3 2006/03/15 14:04:37 elmex Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
1545 | |
1545 | |
1546 | strcpy(retbuf,""); |
1546 | strcpy(retbuf,""); |
1547 | strcpy(retbuf_all," all"); |
1547 | strcpy(retbuf_all," all"); |
1548 | |
1548 | |
1549 | /* Quick check, and probably fairly common */ |
1549 | /* Quick check, and probably fairly common */ |
1550 | if (mt == MOVE_ALL) return retbuf_all; |
1550 | if (mt == MOVE_ALL) return retbuf_all+1; |
1551 | if (mt == 0) { |
1551 | if (mt == 0) { |
1552 | strcpy(retbuf,"0"); |
1552 | strcpy(retbuf,"0"); |
1553 | return retbuf; |
1553 | return retbuf; |
1554 | } |
1554 | } |
1555 | |
1555 | |
… | |
… | |
1570 | /* Basically, if there is a single negation, return it, eg |
1570 | /* Basically, if there is a single negation, return it, eg |
1571 | * 'all -swim'. But more than that, just return the |
1571 | * 'all -swim'. But more than that, just return the |
1572 | * enumerated values. It doesn't make sense to return |
1572 | * enumerated values. It doesn't make sense to return |
1573 | * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' |
1573 | * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' |
1574 | */ |
1574 | */ |
1575 | if (all_count <=1) return retbuf_all; |
1575 | if (all_count <=1) return retbuf_all+1; |
1576 | else return retbuf; |
1576 | else return retbuf+1; |
1577 | } |
1577 | } |
1578 | |
1578 | |
1579 | |
1579 | |
1580 | /* |
1580 | /* |
1581 | * Returns a pointer to a static string which contains all variables |
1581 | * Returns a pointer to a static string which contains all variables |
… | |
… | |
1767 | if(op->stats.maxgrace!=op2->stats.maxgrace) |
1767 | if(op->stats.maxgrace!=op2->stats.maxgrace) |
1768 | FAST_SAVE_LONG(fastbuf,"maxgrace ",op->stats.maxgrace,9); |
1768 | FAST_SAVE_LONG(fastbuf,"maxgrace ",op->stats.maxgrace,9); |
1769 | |
1769 | |
1770 | if(op->stats.exp!=op2->stats.exp) { |
1770 | if(op->stats.exp!=op2->stats.exp) { |
1771 | #ifndef WIN32 |
1771 | #ifndef WIN32 |
1772 | sprintf(buf2,"%lld\n", op->stats.exp); |
1772 | sprintf(buf2,"%lld", op->stats.exp); |
1773 | #else |
1773 | #else |
1774 | sprintf(buf2,"%I64d\n", op->stats.exp); |
1774 | sprintf(buf2,"%I64d", op->stats.exp); |
1775 | #endif |
1775 | #endif |
1776 | ADD_STRINGLINE_ENTRY(fastbuf,"exp ", buf2, 4); |
1776 | ADD_STRINGLINE_ENTRY(fastbuf,"exp ", buf2, 4); |
1777 | } |
1777 | } |
1778 | |
1778 | |
1779 | if(op->perm_exp!=op2->perm_exp) { |
1779 | if(op->perm_exp!=op2->perm_exp) { |
1780 | #ifndef WIN32 |
1780 | #ifndef WIN32 |
1781 | sprintf(buf2,"%lld\n", op->perm_exp); |
1781 | sprintf(buf2,"%lld", op->perm_exp); |
1782 | #else |
1782 | #else |
1783 | sprintf(buf2,"%I64d\n", op->perm_exp); |
1783 | sprintf(buf2,"%I64d", op->perm_exp); |
1784 | #endif |
1784 | #endif |
1785 | ADD_STRINGLINE_ENTRY(fastbuf,"perm_exp ", buf2, 9); |
1785 | ADD_STRINGLINE_ENTRY(fastbuf,"perm_exp ", buf2, 9); |
1786 | } |
1786 | } |
1787 | |
1787 | |
1788 | if(op->expmul!=op2->expmul) |
1788 | if(op->expmul!=op2->expmul) |
… | |
… | |
1933 | * save (say to a temp map, where we don't care about strings), |
1933 | * save (say to a temp map, where we don't care about strings), |
1934 | * or a slower save/dm dump, where printing out strings is handy. |
1934 | * or a slower save/dm dump, where printing out strings is handy. |
1935 | */ |
1935 | */ |
1936 | if (op->move_type != op2->move_type) { |
1936 | if (op->move_type != op2->move_type) { |
1937 | /*FAST_SAVE_LONG(fastbuf,"move_type ",op->move_type,10)*/ |
1937 | /*FAST_SAVE_LONG(fastbuf,"move_type ",op->move_type,10)*/ |
1938 | ADD_STRINGLINE_ENTRY(fastbuf,"move_type ", |
1938 | ADD_STRINGLINE_ENTRY(fastbuf,"move_type ", |
1939 | get_string_move_type(op->move_type), |
1939 | get_string_move_type(op->move_type), |
1940 | 10); |
1940 | 10); |
1941 | } |
1941 | } |
1942 | if (op->move_block != op2->move_block) { |
1942 | if (op->move_block != op2->move_block) { |
1943 | /*FAST_SAVE_LONG(fastbuf,"move_block ",op->move_block,11)*/ |
1943 | /*FAST_SAVE_LONG(fastbuf,"move_block ",op->move_block,11)*/ |
1944 | ADD_STRINGLINE_ENTRY(fastbuf,"move_block ", |
1944 | ADD_STRINGLINE_ENTRY(fastbuf,"move_block ", |
1945 | get_string_move_type(op->move_block), |
1945 | get_string_move_type(op->move_block), |
1946 | 11); |
1946 | 11); |
1947 | } |
1947 | } |
1948 | if (op->move_allow != op2->move_allow) { |
1948 | if (op->move_allow != op2->move_allow) { |
1949 | /*FAST_SAVE_LONG(fastbuf,"move_allow ",op->move_allow,11);*/ |
1949 | /*FAST_SAVE_LONG(fastbuf,"move_allow ",op->move_allow,11);*/ |
1950 | ADD_STRINGLINE_ENTRY(fastbuf,"move_allow ", |
1950 | ADD_STRINGLINE_ENTRY(fastbuf,"move_allow ", |
1951 | get_string_move_type(op->move_allow), |
1951 | get_string_move_type(op->move_allow), |
1952 | 11); |
1952 | 11); |
1953 | } |
1953 | } |
1954 | if (op->move_on != op2->move_on) { |
1954 | if (op->move_on != op2->move_on) { |
1955 | /*FAST_SAVE_LONG(fastbuf,"move_on ",op->move_on,8);*/ |
1955 | /*FAST_SAVE_LONG(fastbuf,"move_on ",op->move_on,8);*/ |
1956 | ADD_STRINGLINE_ENTRY(fastbuf,"move_on ", |
1956 | ADD_STRINGLINE_ENTRY(fastbuf,"move_on ", |
1957 | get_string_move_type(op->move_on), |
1957 | get_string_move_type(op->move_on), |
1958 | 8); |
1958 | 8); |
1959 | } |
1959 | } |
1960 | if (op->move_off != op2->move_off) { |
1960 | if (op->move_off != op2->move_off) { |
1961 | /*FAST_SAVE_LONG(fastbuf,"move_off ",op->move_off,9);*/ |
1961 | /*FAST_SAVE_LONG(fastbuf,"move_off ",op->move_off,9);*/ |
1962 | ADD_STRINGLINE_ENTRY(fastbuf,"move_off ", |
1962 | ADD_STRINGLINE_ENTRY(fastbuf,"move_off ", |
1963 | get_string_move_type(op->move_off), |
1963 | get_string_move_type(op->move_off), |
1964 | 9); |
1964 | 9); |
1965 | } |
1965 | } |
1966 | if (op->move_slow != op2->move_slow) { |
1966 | if (op->move_slow != op2->move_slow) { |
1967 | /*FAST_SAVE_LONG(fastbuf,"move_slow ",op->move_slow,10);*/ |
1967 | /*FAST_SAVE_LONG(fastbuf,"move_slow ",op->move_slow,10);*/ |
1968 | ADD_STRINGLINE_ENTRY(fastbuf,"move_slow ", |
1968 | ADD_STRINGLINE_ENTRY(fastbuf,"move_slow ", |
1969 | get_string_move_type(op->move_slow), |
1969 | get_string_move_type(op->move_slow), |
1970 | 10); |
1970 | 10); |
1971 | } |
1971 | } |
1972 | |
1972 | |
1973 | if (op->move_slow_penalty != op2->move_slow_penalty) { |
1973 | if (op->move_slow_penalty != op2->move_slow_penalty) { |