# [PROG] changing the value of player

Pavel Curtis (pavel@parc.xerox.com)
Wed, 20 Sep 1995 10:09:51 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    ThwartedEfforts writes:
    > Well, is this code _susposed_ to work:
    >
    > @verb me:call_as this none this rxd $archwizard
    > @program me:call_as
    > player = args[1];
    > object = args[2];
    > verb = args[3];
    > args = args[4..length(args)];
    > set_task_perms(player);
    > return object:(verb)(@args);
    >
    > The problem is, the new value of player doesn't survive because of the
    >  set_task_perms() (assume that args[1] was a non-wizard)...

    The code is *not* supposed to work.  You have to do this in two steps; one
    wizardly verb changes `player' and then calls another (or the same!) wizardly
    verb to do the set_task_perms() and call the intended target.  We have a couple
    of places in Jupiter where we do this and in both cases we managed to have the
    same verb do double duty.  Think of it as a challenge... :-)