TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

[Bug: Beta of 20121127] Errors in code

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Tue Nov 27, 2012 6:08 pm    Post subject: [Bug: Beta of 20121127] Errors in code Reply with quote

Great minds think alike it seems, your command to save in a variable all the stuff associated with an exit is identical to one I came up with (except I called it "info") when I realised there was no way previously to access the information in a script. However you have used the wrong 'C' variable in the place indicated, with the result that no matter what variable name is supplied to hold the information, as written it will be placed in one called "save" or "SAVE"...
Code:
diff -p -U 6 ./tt_2_00_8/src//mapper.c ./tt_2_00_9_beta/src//mapper.c
--- ./tt_2_00_8/src//mapper.c   2011-11-07 02:45:18.000000000 +0000
+++ ./tt_2_00_9_beta/src//mapper.c   2012-11-25 20:30:13.000000000 +0000
@@ -422,12 +428,23 @@ DO_MAP(map_exit)
    else if (is_abbrev(arg2, "NAME"))
    {
       exit->name = restring(exit->name, arg3);
 
       show_message(ses, -1, "#MAP EXIT {%s} : NAME SET TO {%s}.", arg1, exit->name);
    }
+   else if (is_abbrev(arg2, "SAVE"))
+   {
+      if (*arg3)
+      {
+         set_nest_node(ses->list[LIST_VARIABLE], /* Think this should be arg3 ->*/ arg2, "{command}{%s}{destination}{%d}{dir}{%d}{flags}{%d}{name}{%s}{vnum}{%d}", exit->cmd, tunnel_void(ses, ses->map->in_room, exit->vnum, exit->dir), exit->dir, exit->flags, exit->name, exit->vnum);
+      }
+      else
+      {
+         tintin_printf2(ses, "#MAP EXIT SAVE: No destination variable.");
+      }
+   }
    else if (is_abbrev(arg2, "SET"))
    {
       exit->data = restring(exit->data, arg3);
 
       show_message(ses, -1, "#MAP EXIT {%s} : DATA SET TO {%s}.", arg1, exit->data);
    }
I think it should be "arg3" used there...!

Ah, also spotted a typo in the the DO_MAP(map_flag) function, which is also in the mapper.c file:
Code:

@@ -639,12 +651,30 @@ DO_MAP(map_flag)
       show_message(ses, -1, "#MAP: MudFont flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_MUDFONT) ? "on" : "off");
    }
    else if (is_abbrev(arg1, "nofollow"))
    {
       show_message(ses, -1, "#MAP: NoFollow flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_NOFOLLOW) ? "on" : "off");
    }
+   else if (is_abbrev(arg1, "static"))
+   {
+      show_message(ses, -1, "#MAP: Static flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_STATIC) ? "on" : "off");
+   }
+   else if (is_abbrev(arg1, "symbolfgraphics")) /* Should be "symbolgraphics" !*/
+   {
+      show_message(ses, -1, "#MAP: Symbolgraphics flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_SYMBOLGRAPHICS) ? "on" : "off");
+   }
+   else if (is_abbrev(arg1, "vtgraphics"))
+   {
+      show_message(ses, -1, "#MAP: VTgraphics flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_VTGRAPHICS) ? "on" : "off");
+   }
+   else if (is_abbrev(arg1, "vtmap"))
+   {
+      show_message(ses, -1, "#MAP: VTmap flag set to %s.", HAS_BIT(ses->map->flags, MAP_FLAG_VTMAP) ? "on" : "off");
+   }
+
+
 }
 
 DO_MAP(map_get)
 {
    struct room_data *room = ses->map->room_list[ses->map->in_room];
    struct exit_data *exit;

Coffee
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Tue Nov 27, 2012 9:29 pm    Post subject: Reply with quote

Thanks for spotting that. Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group