2007-01-03 03:11:53 +00:00
|
|
|
|
/*! \file rob.cpp
|
|
|
|
|
|
* \brief Commands dealing with giving/taking/killing things or money.
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
|
|
|
|
|
#include "copyright.h"
|
|
|
|
|
|
#include "autoconf.h"
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
#include "externs.h"
|
|
|
|
|
|
|
|
|
|
|
|
void do_kill
|
|
|
|
|
|
(
|
|
|
|
|
|
dbref executor,
|
|
|
|
|
|
dbref caller,
|
|
|
|
|
|
dbref enactor,
|
2007-09-01 23:47:27 -07:00
|
|
|
|
int eval,
|
2006-09-01 22:59:23 +00:00
|
|
|
|
int key,
|
|
|
|
|
|
int nargs,
|
2007-03-14 00:55:08 +00:00
|
|
|
|
UTF8 *what,
|
2007-09-02 21:44:11 -07:00
|
|
|
|
UTF8 *costchar,
|
|
|
|
|
|
const UTF8 *cargs[],
|
|
|
|
|
|
int ncargs
|
2006-09-01 22:59:23 +00:00
|
|
|
|
)
|
|
|
|
|
|
{
|
|
|
|
|
|
UNUSED_PARAMETER(caller);
|
|
|
|
|
|
UNUSED_PARAMETER(enactor);
|
2007-09-01 23:47:27 -07:00
|
|
|
|
UNUSED_PARAMETER(eval);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
UNUSED_PARAMETER(nargs);
|
2007-09-02 21:44:11 -07:00
|
|
|
|
UNUSED_PARAMETER(cargs);
|
|
|
|
|
|
UNUSED_PARAMETER(ncargs);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
|
|
|
|
|
init_match(executor, what, TYPE_PLAYER);
|
|
|
|
|
|
match_neighbor();
|
|
|
|
|
|
match_me();
|
|
|
|
|
|
match_here();
|
|
|
|
|
|
if (Long_Fingers(executor))
|
|
|
|
|
|
{
|
|
|
|
|
|
match_player();
|
|
|
|
|
|
match_absolute();
|
|
|
|
|
|
}
|
|
|
|
|
|
dbref victim = match_result();
|
|
|
|
|
|
|
|
|
|
|
|
switch (victim)
|
|
|
|
|
|
{
|
|
|
|
|
|
case NOTHING:
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(executor, M_("I don’t see that player here."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case AMBIGUOUS:
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(executor, M_("I don’t know who you mean!"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
if ( !isPlayer(victim)
|
|
|
|
|
|
&& !isThing(victim))
|
|
|
|
|
|
{
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(executor, M_("Sorry, you can only kill players and things."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( ( Haven(Location(victim))
|
|
|
|
|
|
&& !Wizard(executor))
|
|
|
|
|
|
|| ( Controls(victim, Location(victim))
|
|
|
|
|
|
&& !Controls(executor, Location(victim)))
|
|
|
|
|
|
|| Unkillable(victim))
|
|
|
|
|
|
{
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(executor, M_("Sorry."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Go for it.
|
|
|
|
|
|
//
|
|
|
|
|
|
int cost = 0;
|
|
|
|
|
|
if (key == KILL_KILL)
|
|
|
|
|
|
{
|
fix(win32): migrate the remaining mux_atol callers to mux_atoi64 (#1373)
Completes the sweep the issue called for. mux_atol returns long, which
is 32-bit on LLP64, so every caller silently truncated on Windows. Two
of those were real defects (the truthiness family and cf_size, fixed in
the preceding commits); the rest were latent, waiting for a value large
enough to matter.
Rather than audit 290 sites for whether each can reach 2^31 today, use
the 64-bit parser everywhere and remove the class. A dbref cannot
overflow now, but nothing stops a later caller passing that same site a
timestamp or a byte count.
Pure 1:1 substitution: 285 lines changed, and every removed line
contained mux_atol while every added line contains mux_atoi64. No
control flow, no types, no behaviour beyond the wider parse.
This is a NO-OP on LP64 -- long is already 64-bit on Linux and macOS, so
the generated code there is unchanged. It only widens the parse on
Windows. Narrowing destinations are unaffected either way: `int x =
mux_atoi64(s)` truncates exactly as `int x = mux_atol(s)` did, on both
models.
Left alone: mux_atol itself in mathutil, its declaration, and three
comments that name it. Callers that genuinely want 32-bit semantics can
still ask for them; none appear to.
Verified on Windows: full solution builds clean with no new warnings,
smoke is 1418 passed / 16 failed / 0 crashes / 306 of 306 dispatched --
identical to before the sweep, with the same 16 build-configuration
failures (exp3 module not loaded, hmac/digest behind UNIX_DIGEST).
Spot checks after the change: the boolean family returns 1 for multiples
of 2^32, cf_size round-trips 3000000000 and still reads -1 as unlimited,
and arithmetic, string and list functions are unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 10:03:45 -06:00
|
|
|
|
cost = mux_atoi64(costchar);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
if (cost < mudconf.killmin)
|
|
|
|
|
|
{
|
|
|
|
|
|
cost = mudconf.killmin;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (cost > mudconf.killmax)
|
|
|
|
|
|
{
|
|
|
|
|
|
cost = mudconf.killmax;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// See if it works.
|
|
|
|
|
|
//
|
|
|
|
|
|
if (!payfor(executor, cost))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(executor, tprintf(M_("You don’t have enough %s."), mudconf.many_coins));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( RealWizard(victim)
|
|
|
|
|
|
|| ( 0 < mudconf.killguarantee
|
|
|
|
|
|
&& !( RandomINT32(0, mudconf.killguarantee-1) < cost
|
|
|
|
|
|
|| key == KILL_SLAY)))
|
|
|
|
|
|
{
|
|
|
|
|
|
// Failure: notify player and victim only.
|
|
|
|
|
|
//
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(executor, M_("Your murder attempt failed."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
LBuf buf1 = LBuf_Src("do_kill.failed");
|
2026-07-27 13:56:53 +00:00
|
|
|
|
mux_sprintf(buf1, LBUF_SIZE, M_("%s tried to kill you!"), Moniker(executor));
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
notify_with_cause_ooc(victim, executor, buf1, MSG_SRC_KILL);
|
|
|
|
|
|
if (Suspect(executor))
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
mux_strncpy(buf1, Moniker(executor), LBUF_SIZE-1);
|
|
|
|
|
|
if (executor == Owner(executor))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
raw_broadcast(WIZARD, M_("[Suspect] %s tried to kill %s(#%d)."), buf1.get(), Moniker(victim), victim);
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
LBuf buf2 = LBuf_Src("do_kill.SUSP.failed");
|
|
|
|
|
|
mux_strncpy(buf2, Moniker(Owner(executor)), LBUF_SIZE-1);
|
2026-07-27 13:56:53 +00:00
|
|
|
|
raw_broadcast(WIZARD, M_("[Suspect] %s <via %s(#%d)> tried to kill %s(#%d)."),
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
buf2.get(), buf1.get(), executor, Moniker(victim), victim);
|
|
|
|
|
|
}
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Success! You killed him
|
|
|
|
|
|
//
|
|
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
LBuf buf1 = LBuf_Src("do_kill.succ.1");
|
|
|
|
|
|
LBuf buf2 = LBuf_Src("do_kill.succ.2");
|
|
|
|
|
|
if (Suspect(executor))
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
mux_strncpy(buf1, Moniker(executor), LBUF_SIZE-1);
|
|
|
|
|
|
if (executor == Owner(executor))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
raw_broadcast(WIZARD, M_("[Suspect] %s killed %s(#%d)."), buf1.get(), Moniker(victim), victim);
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
mux_strncpy(buf2, Moniker(Owner(executor)), LBUF_SIZE-1);
|
2026-07-27 13:56:53 +00:00
|
|
|
|
raw_broadcast(WIZARD, M_("[Suspect] %s <via %s(#%d)> killed %s(#%d)."),
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
buf2.get(), buf1.get(), executor, Moniker(victim), victim);
|
|
|
|
|
|
}
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
2026-07-27 13:56:53 +00:00
|
|
|
|
mux_sprintf(buf1, LBUF_SIZE, M_("You killed %s!"), Moniker(victim));
|
|
|
|
|
|
mux_sprintf(buf2, LBUF_SIZE, M_("killed %s!"), Moniker(victim));
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
if (!isPlayer(victim))
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
if (halt_que(NOTHING, victim) > 0)
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
if (!Quiet(victim))
|
|
|
|
|
|
{
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(Owner(victim), M_("Halted."));
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
}
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
did_it(executor, victim, A_KILL, buf1, A_OKILL, buf2, A_AKILL, 0,
|
|
|
|
|
|
nullptr, 0);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
// notify victim
|
|
|
|
|
|
//
|
2026-07-27 13:56:53 +00:00
|
|
|
|
mux_sprintf(buf1, LBUF_SIZE, M_("%s killed you!"), Moniker(executor));
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
notify_with_cause_ooc(victim, executor, buf1, MSG_SRC_KILL);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
// Pay off the bonus.
|
|
|
|
|
|
//
|
|
|
|
|
|
if (key == KILL_KILL)
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
cost /= 2; // Victim gets half.
|
|
|
|
|
|
if (Pennies(Owner(victim)) < mudconf.paylimit)
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
mux_sprintf(buf1, LBUF_SIZE, M_("Your insurance policy pays %d %s."), cost,
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
mudconf.many_coins);
|
|
|
|
|
|
notify(victim, buf1);
|
|
|
|
|
|
giveto(Owner(victim), cost);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(victim, M_("Your insurance policy has been revoked."));
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
}
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Send him home.
|
|
|
|
|
|
//
|
|
|
|
|
|
move_via_generic(victim, HOME, NOTHING, 0);
|
|
|
|
|
|
divest_object(victim);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* ---------------------------------------------------------------------------
|
|
|
|
|
|
* * give_thing, give_money, do_give: Give away money or things.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2007-03-14 00:55:08 +00:00
|
|
|
|
static void give_thing(dbref giver, dbref recipient, int key, UTF8 *what)
|
2006-09-01 22:59:23 +00:00
|
|
|
|
{
|
|
|
|
|
|
init_match(giver, what, TYPE_THING);
|
|
|
|
|
|
match_possession();
|
|
|
|
|
|
match_me();
|
|
|
|
|
|
dbref thing = match_result();
|
|
|
|
|
|
|
|
|
|
|
|
switch (thing)
|
|
|
|
|
|
{
|
|
|
|
|
|
case NOTHING:
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(giver, M_("You don’t have that!"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
case AMBIGUOUS:
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(giver, M_("I don’t know which you mean!"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (thing == giver)
|
|
|
|
|
|
{
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(giver, M_("You can’t give yourself away!"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (thing == recipient)
|
|
|
|
|
|
{
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(giver, M_("You can’t give an object to itself."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( (!isThing(thing) && !isPlayer(thing))
|
|
|
|
|
|
|| !( Enter_ok(recipient)
|
|
|
|
|
|
|| Controls(giver, recipient))
|
|
|
|
|
|
|| isGarbage(recipient))
|
|
|
|
|
|
{
|
|
|
|
|
|
notify(giver, NOPERM_MESSAGE);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!could_doit(giver, thing, A_LGIVE))
|
|
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
LBuf str = LBuf_Src("do_give.gfail");
|
|
|
|
|
|
UTF8 *sp = str.get();
|
2026-07-26 21:52:48 -06:00
|
|
|
|
safe_str(T("You can’t give "), str, &sp);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
safe_str(Moniker(thing), str, &sp);
|
2007-03-14 22:33:04 +00:00
|
|
|
|
safe_str(T(" away."), str, &sp);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
*sp = '\0';
|
|
|
|
|
|
|
2018-10-03 17:54:51 +00:00
|
|
|
|
did_it(giver, thing, A_GFAIL, str, A_OGFAIL, nullptr, A_AGFAIL, 0,
|
|
|
|
|
|
nullptr, 0);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!could_doit(thing, recipient, A_LRECEIVE))
|
|
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
LBuf str = LBuf_Src("do_give.rfail");
|
|
|
|
|
|
UTF8 *sp = str.get();
|
2006-09-01 22:59:23 +00:00
|
|
|
|
safe_str(Moniker(recipient), str, &sp);
|
2026-07-26 21:52:48 -06:00
|
|
|
|
safe_str(T(" doesn’t want "), str, &sp);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
safe_str(Moniker(thing), str, &sp);
|
|
|
|
|
|
safe_chr('.', str, &sp);
|
|
|
|
|
|
*sp = '\0';
|
|
|
|
|
|
|
2018-10-03 17:54:51 +00:00
|
|
|
|
did_it(giver, recipient, A_RFAIL, str, A_ORFAIL, nullptr, A_ARFAIL, 0,
|
|
|
|
|
|
nullptr, 0);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
move_via_generic(thing, recipient, giver, 0);
|
|
|
|
|
|
divest_object(thing);
|
|
|
|
|
|
if (!(key & GIVE_QUIET))
|
|
|
|
|
|
{
|
Migrate 22 alloc_lbuf/free_lbuf sites to LBuf RAII
Replace manual alloc_lbuf/free_lbuf pairs with LBuf RAII wrappers
in 12 engine source files: rob, walk, quota, wiz, session, object,
log, match, move, create, flags, boolexp. This eliminates ~40
explicit free_lbuf calls on error paths that are now handled by
destructors, removing leak risk in early-return and multi-exit
functions (boolexp alone had 13 exit-path frees across two
functions). Buffers returned by atr_get/atr_pget or to callers
are left manual since LBuf cannot adopt externally-allocated
buffers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:46:22 -06:00
|
|
|
|
LBuf str = LBuf_Src("do_give.thing.ok");
|
2006-09-01 22:59:23 +00:00
|
|
|
|
mux_strncpy(str, Moniker(giver), LBUF_SIZE-1);
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify_with_cause_ooc(recipient, giver, tprintf(M_("%s gave you %s."), str.get(), Moniker(thing)), MSG_SRC_GIVE);
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(giver, M_("Given."));
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify_with_cause_ooc(thing, giver, tprintf(M_("%s gave you to %s."), str.get(), Moniker(recipient)), MSG_SRC_GIVE);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
2018-10-03 17:54:51 +00:00
|
|
|
|
did_it(giver, thing, A_DROP, nullptr, A_ODROP, nullptr, A_ADROP, 0, nullptr, 0);
|
|
|
|
|
|
did_it(recipient, thing, A_SUCC, nullptr, A_OSUCC, nullptr, A_ASUCC, 0,
|
|
|
|
|
|
nullptr, 0);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void give_money(dbref giver, dbref recipient, int key, int amount)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Do amount consistency check.
|
|
|
|
|
|
//
|
|
|
|
|
|
if ( amount < 0
|
|
|
|
|
|
&& !Steal(giver))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You look through your pockets. Nope, no negative %s."),
|
2006-09-01 22:59:23 +00:00
|
|
|
|
mudconf.many_coins));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!amount)
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You must specify a positive number of %s."),
|
2006-09-01 22:59:23 +00:00
|
|
|
|
mudconf.many_coins));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Wizard(giver))
|
|
|
|
|
|
{
|
|
|
|
|
|
if ( isPlayer(recipient)
|
|
|
|
|
|
&& (Pennies(recipient) + amount > mudconf.paylimit))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("That player doesn’t need that many %s!"),
|
2006-09-01 22:59:23 +00:00
|
|
|
|
mudconf.many_coins));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!could_doit(giver, recipient, A_LUSE))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("%s won’t take your money."), Moniker(recipient)));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Try to do the give.
|
|
|
|
|
|
//
|
|
|
|
|
|
if (!payfor(giver, amount))
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You don’t have that many %s to give!"),
|
2006-09-01 22:59:23 +00:00
|
|
|
|
mudconf.many_coins));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Find out cost if an object.
|
|
|
|
|
|
//
|
|
|
|
|
|
int cost;
|
|
|
|
|
|
if (isThing(recipient))
|
|
|
|
|
|
{
|
|
|
|
|
|
dbref aowner;
|
|
|
|
|
|
int aflags;
|
2026-04-05 18:22:32 -06:00
|
|
|
|
LBuf str = LBuf_Adopt(atr_pget(recipient, A_COST, &aowner, &aflags));
|
fix(win32): migrate the remaining mux_atol callers to mux_atoi64 (#1373)
Completes the sweep the issue called for. mux_atol returns long, which
is 32-bit on LLP64, so every caller silently truncated on Windows. Two
of those were real defects (the truthiness family and cf_size, fixed in
the preceding commits); the rest were latent, waiting for a value large
enough to matter.
Rather than audit 290 sites for whether each can reach 2^31 today, use
the 64-bit parser everywhere and remove the class. A dbref cannot
overflow now, but nothing stops a later caller passing that same site a
timestamp or a byte count.
Pure 1:1 substitution: 285 lines changed, and every removed line
contained mux_atol while every added line contains mux_atoi64. No
control flow, no types, no behaviour beyond the wider parse.
This is a NO-OP on LP64 -- long is already 64-bit on Linux and macOS, so
the generated code there is unchanged. It only widens the parse on
Windows. Narrowing destinations are unaffected either way: `int x =
mux_atoi64(s)` truncates exactly as `int x = mux_atol(s)` did, on both
models.
Left alone: mux_atol itself in mathutil, its declaration, and three
comments that name it. Callers that genuinely want 32-bit semantics can
still ask for them; none appear to.
Verified on Windows: full solution builds clean with no new warnings,
smoke is 1418 passed / 16 failed / 0 crashes / 306 of 306 dispatched --
identical to before the sweep, with the same 16 build-configuration
failures (exp3 module not loaded, hmac/digest behind UNIX_DIGEST).
Spot checks after the change: the boolean family returns 1 for multiples
of 2^32, cf_size round-trips 3000000000 and still reads -1 as unlimited,
and arithmetic, string and list functions are unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 10:03:45 -06:00
|
|
|
|
cost = mux_atoi64(str);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
|
|
|
|
|
// Can't afford it?
|
|
|
|
|
|
//
|
|
|
|
|
|
if (amount < cost)
|
|
|
|
|
|
{
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(giver, M_("Feeling poor today?"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
giveto(giver, amount);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Negative cost
|
|
|
|
|
|
//
|
|
|
|
|
|
if (cost < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
cost = amount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!(key & GIVE_QUIET))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (amount == 1)
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You give a %s to %s."), mudconf.one_coin, Moniker(recipient)));
|
|
|
|
|
|
notify_with_cause_ooc(recipient, giver, tprintf(M_("%s gives you a %s."), Moniker(giver), mudconf.one_coin), MSG_SRC_GIVE);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You give %d %s to %s."), amount, mudconf.many_coins, Moniker(recipient)));
|
|
|
|
|
|
notify_with_cause_ooc(recipient, giver, tprintf(M_("%s gives you %d %s."),
|
2012-04-11 10:44:10 -07:00
|
|
|
|
Moniker(giver), amount, mudconf.many_coins), MSG_SRC_GIVE);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Report change given
|
|
|
|
|
|
//
|
|
|
|
|
|
if ((amount - cost) == 1)
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You get 1 %s in change."), mudconf.one_coin));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
giveto(giver, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (amount != cost)
|
|
|
|
|
|
{
|
2026-07-27 13:56:53 +00:00
|
|
|
|
notify(giver, tprintf(M_("You get %d %s in change."), (amount - cost), mudconf.many_coins));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
giveto(giver, (amount - cost));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Transfer the money and run PAY attributes
|
|
|
|
|
|
//
|
|
|
|
|
|
giveto(recipient, cost);
|
2018-10-03 17:54:51 +00:00
|
|
|
|
did_it(giver, recipient, A_PAY, nullptr, A_OPAY, nullptr, A_APAY, 0, nullptr, 0);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void do_give
|
|
|
|
|
|
(
|
|
|
|
|
|
dbref executor,
|
|
|
|
|
|
dbref caller,
|
|
|
|
|
|
dbref enactor,
|
2007-09-01 23:47:27 -07:00
|
|
|
|
int eval,
|
2006-09-01 22:59:23 +00:00
|
|
|
|
int key,
|
|
|
|
|
|
int nargs,
|
2007-03-14 00:55:08 +00:00
|
|
|
|
UTF8 *who,
|
2007-09-02 21:44:11 -07:00
|
|
|
|
UTF8 *amnt,
|
|
|
|
|
|
const UTF8 *cargs[],
|
|
|
|
|
|
int ncargs
|
2006-09-01 22:59:23 +00:00
|
|
|
|
)
|
|
|
|
|
|
{
|
|
|
|
|
|
UNUSED_PARAMETER(caller);
|
|
|
|
|
|
UNUSED_PARAMETER(enactor);
|
2007-09-01 23:47:27 -07:00
|
|
|
|
UNUSED_PARAMETER(eval);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
UNUSED_PARAMETER(nargs);
|
2007-09-02 21:44:11 -07:00
|
|
|
|
UNUSED_PARAMETER(cargs);
|
|
|
|
|
|
UNUSED_PARAMETER(ncargs);
|
2006-09-01 22:59:23 +00:00
|
|
|
|
|
|
|
|
|
|
// Check recipient.
|
|
|
|
|
|
//
|
|
|
|
|
|
init_match(executor, who, TYPE_PLAYER);
|
|
|
|
|
|
match_neighbor();
|
|
|
|
|
|
match_possession();
|
|
|
|
|
|
match_me();
|
|
|
|
|
|
if (Long_Fingers(executor))
|
|
|
|
|
|
{
|
|
|
|
|
|
match_player();
|
|
|
|
|
|
match_absolute();
|
|
|
|
|
|
}
|
|
|
|
|
|
dbref recipient = match_result();
|
|
|
|
|
|
switch (recipient)
|
|
|
|
|
|
{
|
|
|
|
|
|
case NOTHING:
|
2026-07-27 01:58:14 +00:00
|
|
|
|
notify(executor, M_("Give to whom?"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
case AMBIGUOUS:
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(executor, M_("I don’t know who you mean!"));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isExit(recipient))
|
|
|
|
|
|
{
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(executor, M_("You can’t give anything to an exit."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Guest(recipient))
|
|
|
|
|
|
{
|
2026-07-26 21:52:48 -06:00
|
|
|
|
notify(executor, M_("Guests really don’t need money or anything."));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (is_rational(amnt))
|
|
|
|
|
|
{
|
fix(win32): migrate the remaining mux_atol callers to mux_atoi64 (#1373)
Completes the sweep the issue called for. mux_atol returns long, which
is 32-bit on LLP64, so every caller silently truncated on Windows. Two
of those were real defects (the truthiness family and cf_size, fixed in
the preceding commits); the rest were latent, waiting for a value large
enough to matter.
Rather than audit 290 sites for whether each can reach 2^31 today, use
the 64-bit parser everywhere and remove the class. A dbref cannot
overflow now, but nothing stops a later caller passing that same site a
timestamp or a byte count.
Pure 1:1 substitution: 285 lines changed, and every removed line
contained mux_atol while every added line contains mux_atoi64. No
control flow, no types, no behaviour beyond the wider parse.
This is a NO-OP on LP64 -- long is already 64-bit on Linux and macOS, so
the generated code there is unchanged. It only widens the parse on
Windows. Narrowing destinations are unaffected either way: `int x =
mux_atoi64(s)` truncates exactly as `int x = mux_atol(s)` did, on both
models.
Left alone: mux_atol itself in mathutil, its declaration, and three
comments that name it. Callers that genuinely want 32-bit semantics can
still ask for them; none appear to.
Verified on Windows: full solution builds clean with no new warnings,
smoke is 1418 passed / 16 failed / 0 crashes / 306 of 306 dispatched --
identical to before the sweep, with the same 16 build-configuration
failures (exp3 module not loaded, hmac/digest behind UNIX_DIGEST).
Spot checks after the change: the boolean family returns 1 for multiples
of 2^32, cf_size round-trips 3000000000 and still reads -1 as unlimited,
and arithmetic, string and list functions are unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 10:03:45 -06:00
|
|
|
|
give_money(executor, recipient, key, mux_atoi64(amnt));
|
2006-09-01 22:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
give_thing(executor, recipient, key, amnt);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|