… | |
… | |
1102 | object_thawer f (buf, (AV *)0); |
1102 | object_thawer f (buf, (AV *)0); |
1103 | |
1103 | |
1104 | return op->parse_kv (f); |
1104 | return op->parse_kv (f); |
1105 | } |
1105 | } |
1106 | |
1106 | |
1107 | /* This returns a string of the integer movement type */ |
|
|
1108 | #if 0 |
|
|
1109 | // unused function |
|
|
1110 | static char * |
|
|
1111 | get_string_move_type (MoveType mt) |
|
|
1112 | { |
|
|
1113 | static char retbuf[MAX_BUF], retbuf_all[MAX_BUF]; |
|
|
1114 | int i, all_count = 0, count; |
|
|
1115 | |
|
|
1116 | strcpy (retbuf, ""); |
|
|
1117 | strcpy (retbuf_all, " all"); |
|
|
1118 | |
|
|
1119 | /* Quick check, and probably fairly common */ |
|
|
1120 | if (mt == MOVE_ALL) |
|
|
1121 | return retbuf_all + 1; |
|
|
1122 | if (mt == 0) |
|
|
1123 | { |
|
|
1124 | strcpy (retbuf, "0"); |
|
|
1125 | return retbuf; |
|
|
1126 | } |
|
|
1127 | |
|
|
1128 | /* We basically slide the bits down. Why look at MOVE_ALL? |
|
|
1129 | * because we may want to return a string like 'all -swim', |
|
|
1130 | * and if we just looked at mt, we couldn't get that. |
|
|
1131 | */ |
|
|
1132 | for (i = MOVE_ALL, count = 0; i != 0; i >>= 1, count++) |
|
|
1133 | { |
|
|
1134 | if (mt & (1 << count)) |
|
|
1135 | { |
|
|
1136 | strcat (retbuf, " "); |
|
|
1137 | strcat (retbuf, move_name[count]); |
|
|
1138 | } |
|
|
1139 | else |
|
|
1140 | { |
|
|
1141 | strcat (retbuf_all, " -"); |
|
|
1142 | strcat (retbuf_all, move_name[count]); |
|
|
1143 | all_count++; |
|
|
1144 | } |
|
|
1145 | } |
|
|
1146 | /* Basically, if there is a single negation, return it, eg |
|
|
1147 | * 'all -swim'. But more than that, just return the |
|
|
1148 | * enumerated values. It doesn't make sense to return |
|
|
1149 | * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' |
|
|
1150 | */ |
|
|
1151 | if (all_count <= 1) |
|
|
1152 | return retbuf_all + 1; |
|
|
1153 | else |
|
|
1154 | return retbuf + 1; |
|
|
1155 | } |
|
|
1156 | #endif |
|
|
1157 | |
|
|
1158 | // compare *op against *tmp and output differences |
1107 | // compare *op against *tmp and output differences |
1159 | static void |
1108 | static void |
1160 | write_diff (object_freezer &f, object *op, object *tmp) |
1109 | write_diff (object_freezer &f, object *op, object *tmp) |
1161 | { |
1110 | { |
1162 | static const keyword resist_save[NROFATTACKS] = { |
1111 | static const keyword resist_save[NROFATTACKS] = { |