Files
nethack/include
nhmall 61f969e88b follow-up for put_saddle_on_mon()
Commit 1acc2727 helped ensure that the which_armor(mtmp, W_SADDLE)
test at the top of put_saddle_on_mon() wouldn't lead to an obj
leak.

This commit covers off the adjacent can_saddle() test in
put_saddle_on_mon(), because if that failed, it could also lead
to a memory leak of the saddle obj passed by the caller.

- have put_saddle_on_mon() create and use its own saddle obj
  if a NULL saddle obj is passed, instead of having to do that
  in the caller.
- where an existing saddle obj needs to be passed from the caller,
  ensure that the caller has done its own can_saddle(mon) check prior
  to calling put_saddle_on_mon(), so that the can_saddle() test
  in put_saddle_on_mon() won't fail.
- lastly, add an impossible() to put_saddle_on_mon() to catch
  a failure when a saddle obj is passed from the caller and either
  test has failed, just in case. That should not happen with any of
  the existing cases now, but it will provide some bullet-proofing
  for new code, new callers.
2025-01-20 14:37:46 -05:00
..
2022-02-04 11:01:20 -05:00
2022-03-13 13:58:56 -07:00
2022-11-29 21:53:21 -05:00
2024-02-28 11:47:16 -08:00
2024-12-15 09:53:50 -05:00
2024-11-23 19:04:12 +02:00
2022-06-30 23:48:18 -04:00
2024-12-20 10:32:38 -05:00
2025-01-14 11:33:30 -05:00
2024-09-06 13:08:07 -07:00
2023-03-01 14:00:29 +02:00
2024-10-12 14:56:36 -04:00
2021-01-26 21:06:16 -05:00
2024-12-19 18:18:11 -08:00
2025-01-20 14:37:46 -05:00
2024-10-05 15:55:20 -04:00
2024-07-07 17:34:37 -07:00
2024-09-06 13:08:07 -07:00
2022-06-19 02:30:45 -07:00
2024-09-06 13:08:07 -07:00
2024-02-28 20:15:56 -08:00
2024-02-24 13:49:51 -08:00
2025-01-12 14:08:15 -05:00
2024-09-18 21:39:55 +03:00
2024-12-20 10:32:38 -05:00
2024-09-06 13:08:07 -07:00
2024-11-26 20:57:11 -08:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2023-10-16 09:11:05 -04:00
2024-03-07 11:01:04 -05:00
2024-02-28 20:15:56 -08:00
2024-09-06 13:08:07 -07:00
2024-03-07 11:01:04 -05:00
2024-08-17 11:19:45 -07:00
2024-11-13 09:07:10 -05:00
2023-11-22 16:01:58 -05:00
2020-08-12 16:15:28 -07:00
2025-01-19 21:55:36 -05:00
2024-06-15 19:04:57 +03:00
2024-12-20 10:32:38 -05:00
2024-12-20 10:32:38 -05:00
2024-09-06 13:08:07 -07:00
2022-06-30 23:48:18 -04:00
2025-01-04 23:38:34 -05:00
2025-01-04 19:01:34 -05:00
2025-01-04 23:38:34 -05:00
2025-01-04 23:38:34 -05:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2024-11-26 20:57:11 -08:00