… | |
… | |
1245 | */ |
1245 | */ |
1246 | static void |
1246 | static void |
1247 | apply_sign (object *op, object *sign, int autoapply) |
1247 | apply_sign (object *op, object *sign, int autoapply) |
1248 | { |
1248 | { |
1249 | readable_message_type *msgType; |
1249 | readable_message_type *msgType; |
1250 | char newbuf[HUGE_BUF]; |
|
|
1251 | |
1250 | |
1252 | if (sign->msg == NULL) |
1251 | if (sign->msg == NULL) |
1253 | { |
1252 | { |
1254 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing is written on it."); |
1253 | new_draw_info (NDI_UNIQUE, 0, op, "Nothing is written on it."); |
1255 | return; |
1254 | return; |
… | |
… | |
1276 | if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ) && !sign->move_on) |
1275 | if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ) && !sign->move_on) |
1277 | { |
1276 | { |
1278 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to read while blind."); |
1277 | new_draw_info (NDI_UNIQUE, 0, op, "You are unable to read while blind."); |
1279 | return; |
1278 | return; |
1280 | } |
1279 | } |
|
|
1280 | |
|
|
1281 | if (op->contr) |
|
|
1282 | if (client *ns = op->contr->ns) |
|
|
1283 | { |
1281 | msgType = get_readable_message_type (sign); |
1284 | msgType = get_readable_message_type (sign); |
|
|
1285 | |
|
|
1286 | if (ns->can_msg) |
|
|
1287 | ns->send_msg (NDI_NAVY, msgType->msgtype, &sign->msg); |
|
|
1288 | else |
|
|
1289 | { |
|
|
1290 | char newbuf[HUGE_BUF]; |
1282 | snprintf (newbuf, sizeof (newbuf), "%hhu %s", autoapply ? 1 : 0, &sign->msg); |
1291 | snprintf (newbuf, sizeof (newbuf), "%u %s", autoapply ? 1 : 0, &sign->msg); |
1283 | draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, newbuf, &sign->msg); |
1292 | draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, newbuf, &sign->msg); |
|
|
1293 | } |
|
|
1294 | } |
1284 | } |
1295 | } |
1285 | |
1296 | |
1286 | /** |
1297 | /** |
1287 | * 'victim' moves onto 'trap' |
1298 | * 'victim' moves onto 'trap' |
1288 | * 'victim' leaves 'trap' |
1299 | * 'victim' leaves 'trap' |
… | |
… | |
1314 | { |
1325 | { |
1315 | LOG (llevDebug, "WARNING: move_apply(): aborting recursion " |
1326 | LOG (llevDebug, "WARNING: move_apply(): aborting recursion " |
1316 | "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->archname, &trap->name, &victim->arch->archname, &victim->name); |
1327 | "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->archname, &trap->name, &victim->arch->archname, &victim->name); |
1317 | return; |
1328 | return; |
1318 | } |
1329 | } |
|
|
1330 | |
1319 | recursion_depth++; |
1331 | recursion_depth++; |
1320 | if (trap->head) |
1332 | if (trap->head) |
1321 | trap = trap->head; |
1333 | trap = trap->head; |
1322 | |
1334 | |
1323 | if (INVOKE_OBJECT (MOVE_TRIGGER, trap, ARG_OBJECT (victim), ARG_OBJECT (originator))) |
1335 | if (INVOKE_OBJECT (MOVE_TRIGGER, trap, ARG_OBJECT (victim), ARG_OBJECT (originator))) |