OSDN Git Service

comments and line breaks
authorole1986 <ole.k@web.de>
Thu, 14 Aug 2014 08:22:54 +0000 (10:22 +0200)
committerole1986 <ole.k@web.de>
Thu, 14 Aug 2014 08:22:54 +0000 (10:22 +0200)
plugins/Radegast.Plugin.EVOVend/EVOvendPlugin.cs

index 0e08253..975bb1a 100644 (file)
@@ -119,9 +119,14 @@ namespace Radegast.Plugin.EVOVend
 
             if(result > 0){
                 instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": Product " + e.Item.Name + " from Agent " + offeredAgent.ToString() + " accepted and inserted", ChatBufferTextStyle.StatusBlue);
-                client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps"); 
-            } else
-                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": ADDPRODUCT FAILED: "+str+" [ITEM: " + e.Item.Name + " AGENT: " + offeredAgent.ToString() + "]", ChatBufferTextStyle.Error);
+                client.Self.InstantMessage(offeredAgent, "Your Object has been transfered successfully. Please visit " + this.loginURL + " for further steps");
+            }
+            else
+            {
+                // if there is ANY error, delete the object
+                instance.MainForm.TabConsole.DisplayNotificationInChat(pluginName + ": ADDPRODUCT FAILED\n" + str + "\n\n[ITEM: " + e.Item.Name + " AGENT: " + offeredAgent.ToString() + "]", ChatBufferTextStyle.Error);
+                client.Inventory.RemoveItem(e.Item.UUID);
+            }
 
             offeredAgent = UUID.Zero;
         }