Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Mpoload problem
Forum Rules | Mark all | Recent Posts

Mpoload problem
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 30, 2010, 9:21 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

For some reasons when Rooms and Objs mpoload items they have to drop them. See the program below.


mpoload 9007
drop fruit
mpecho obload test load room

If you remove the remove part the item won't show up in the room on the ground. This is a problem with items loading eachother and rooms loading items.

here is the mpoload

void do_mpoload( CHAR_DATA * ch, char *argument )
{
   char arg1[MIL], arg2[MIL];
   char buf[MSL];
   OBJ_INDEX_DATA *pObjIndex;
   CHAR_DATA *victim = ch;
   OBJ_DATA *obj;
   int level, timer = 0;

   if( !IS_NPC( ch ) || IS_AFFECTED( ch, AFF_CHARM ) )
   {
      send_to_char( "Huh?\r\n", ch );
      return;
   }

   argument = one_argument( argument, arg1 );
   argument = one_argument( argument, arg2 );
   if( arg1 == NULL || arg1[0] == '\0' || !is_number( arg1 ) )
   {
      progbug( "Mpoload - Bad Usage", ch );
      return;
   }

   if( arg2 == NULL || arg2[0] == '\0' )
      level = get_trust( ch );

   else
   {
    if( ( victim = get_char_world( ch, arg2 ) ) == NULL )
      victim = ch;

      /* New feature from Alander. */
/*      if( !is_number( arg2 ) )
      {
        sprintf( buf, "Mpoload - (%s) should be a number for the level", arg2 );
        progbug(buf, ch);
         return;
      }*/
/*
      if( ( level = atoi( arg2 ) ) < 0 || level > get_trust( ch ) )
      {
         sprintf( buf, "Mpoload - Bad level (%d)", level );
         progbug(buf, ch);
         return;
      }
*/
      if( ( timer = atoi( argument ) ) < 0 )
      {
         sprintf( buf, "Mpoload - Bad timer argument (%s)", argument );
         progbug(buf, ch);
         return;
      }
   }

   if( !( pObjIndex = get_obj_index( atoi( arg1 ) ) ) )
   {
      sprintf( buf, "Mpoload - Bad vnum (%s)", arg1 );
      progbug(buf, ch); 
      return;
   }

   if( !( obj = create_object( pObjIndex, pObjIndex->level ) ) )
   {
      progbug( "MpOLoad - obj still NULL after create_object.", ch );
      return;
   }

   obj->timer = timer;
   if( CAN_WEAR( obj, ITEM_TAKE ) )
      obj_to_char( obj, victim );
   else
      obj_to_room( obj, victim->in_room );
}


       
Post is unread #2 Dec 30, 2010, 12:45 pm   Last edited Dec 30, 2010, 12:57 pm by Aurin
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Here's where the issue lies...
dbna2 said:

   if( CAN_WEAR( obj, ITEM_TAKE ) )
      obj_to_char( obj, victim );
   else
      obj_to_room( obj, victim->in_room );


Comment that out, and above it put
obj_to_room(obj, victim->in_room);

This will allow it to load straight to the room without having to be dropped. I'm not sure why the other ifcheck is there, honestly, so it may bug out on you if you remove it. Maybe Remcon can explain why it's there in the first place. Depending on his explanation, I intend to make the same change myself. heh And, to be honest, the ifcheck doesn't even work.
       
Post is unread #3 Dec 30, 2010, 1:00 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Well this is the reasoning for it, mpoload is used for mobs, objects and rooms loading objects and there is always a mobile doing the loading no matter which is doing it, mobs do their own loading, objects and rooms the supermob does the loading, In any way shape or form it is a mobile doing the loading and it assumes that you want the object on them. If you just made it obj_to_room when a mobile loads an object it would just go to the room. not to mention that your also using ch instead of victim in that post aurin so it might put in the wrong room etc...

If you want to do it so rooms and objects auto load to the room instead you would probably want to check if the victim is supermob and if so send it to the room (since he handles all objects and rooms). The check is to see if the item can be picked up if not it puts it in the room, if it can it puts it in the room.
       
Post is unread #4 Dec 30, 2010, 2:51 pm   Last edited Dec 30, 2010, 2:57 pm by Aurin
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Yeah, I made like 30 edits to my post fixing typos. and, I wasn't incorrect in saying 'ch->room' or 'ch' anywhere, as that was the intended usage.
void do_mpoload( CHAR_DATA * ch, char *argument )
{
   char arg1[MIL], arg2[MIL];
   char buf[MSL];
   OBJ_INDEX_DATA *pObjIndex;
   CHAR_DATA *victim = ch;
// ^^^^^ This is redundant, and you might as well just rewrite all victim's to ch, less confusion/misleading
   OBJ_DATA *obj;
   int level, timer = 0;

As you see, victim is already set to ch. So, that could be the issue. Then again, on 6D, we don't even have that line, and just use ch.

okay, I just checked smaugfuss1.9 and see that it also puts mpoload with ch instead of victim. so even with smaugfuss, it won't drop it directly to the room without the drop <item> within the prog after the mpoload.
       
Post is unread #5 Dec 30, 2010, 3:41 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Lol well I went off of what you had posted, and if it had victim and you use ch well thats wrong unless you give more to go on lol :)

Haha, looks like I had stopped using the victim stuff at some point in LoP also.
       
Pages:<< prev 1 next >>