ArcEmu: [Declined][easy Fix] Vendor Restriction - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Declined][easy Fix] Vendor Restriction Mount vendors

#1 User is offline   Nature 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 30-November 09
  • Gender:Male
  • Interests:C++, video editing, games

Posted 01 September 2010 - 04:22 PM

Patch Title: Vendor Restriction fix
What bug does this patch fix: When you are bloodelf you can now buy orc mounts without being exalted or with some other db, you can only buy mounts when you are exalted even your own faction mounts and that is both wrong.
Detailed Explanation: someone used a int8 (for some reason) in comperison with an int32, the racemask is sometimes to big for int8 so it did not work properly.
How to reproduce: buy some other faction mounts, apply, see that now you need exalted with other factions but you can still buy your own faction mounts.


you need the npc flags of the vendors to be 128 (nothing else) and vendor restriction table set up properly


Patch:


Index: src/arcemu-world/ItemHandler.cpp
===================================================================
--- src/arcemu-world/ItemHandler.cpp	(revision 3612)
+++ src/arcemu-world/ItemHandler.cpp	(working copy)
@@ -22,9 +22,9 @@
 
 bool CanBuyAt(Player *plr, VendorRestrictionEntry *vendor)
 {
-	uint8 plracemask = static_cast<uint8>( plr->getRaceMask() );
+	uint32 plracemask = static_cast<uint32>( plr->getRaceMask() );
 	uint32 plrep = plr->GetStanding(vendor->reqrepfaction);
-
+	printf("racemask %i\n",plracemask);
 	/* if either the player has the right race or has the right reputation, he/she can buy at the vendor */
 	if ( (plracemask & vendor->racemask) || (plrep >= vendor->reqrepvalue) )
 		return true;



PS: plz delete the printf line (forgot that one)

Attached File(s)


0

#2 User is offline   WAmadeus 

  • Cunning Code Composer
  • PipPipPip
  • Group: Developers
  • Posts: 287
  • Joined: 23-July 09
  • Gender:Male
  • Location:Brazil

Posted 01 September 2010 - 07:25 PM

http://arcemu.org/fo...showtopic=23064

Which one is right?
0

#3 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 01 September 2010 - 10:49 PM

Why there's a printf (and why are you using %i to print a uint32?) ? And what's the type of getRaceMask(), uint64? I mean, what are you casting to uint32?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#4 User is offline   Nature 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 30-November 09
  • Gender:Male
  • Interests:C++, video editing, games

Posted 02 September 2010 - 02:44 AM

View PostSaintJamesApostle, on 01 September 2010 - 10:49 PM, said:

Why there's a printf (and why are you using %i to print a uint32?) ? And what's the type of getRaceMask(), uint64? I mean, what are you casting to uint32?


plz read :) I said plz delete the printf because I forgot, can submit it again without if you want
the printf was just for my own convenience and printed an unint8 before, and it just works with %i so why not :)

the other topic works as well
        
uint8 plracemask = static_cast<uint8>( plr->getRaceMask() );
uint32 plrep = plr->GetStanding(vendor->reqrepfaction);
 
        /* if either the player has the right race or has the right reputation, he/she can buy at the vendor */
-       if ( (plracemask & vendor->racemask) || (plrep >= vendor->reqrepvalue) )
+       if ( (plr->getRaceMask() & vendor->racemask) || (plrep >= vendor->reqrepvalue) )

he actually does the same, you can even delete the unit8.... line because he never uses the plracemask anyway.
So I get the racemask whitch has actually not to be cast your right, and then uses the var in the if statement, while the other topic uses the racemask directly, either way it is fixed so I dont care witch one you apply.
I did not now there was another topic for it

x
Nature
0

#5 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 02 September 2010 - 03:52 AM

I don't like much the "it works so why not used it" approach...
Other than this, the rest looks ok. Just a uint32 downcasted to uint8 for not particular reason as it seems.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#6 User is offline   Sadikum 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 367
  • Joined: 16-June 08
  • Gender:Male

Posted 02 September 2010 - 01:29 PM

Better to apply: http://arcemu.org/fo...showtopic=23077 it fix it by a better way and fix some other things.
Sorry for my english, I'm french.
0

#7 User is offline   Nature 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 30-November 09
  • Gender:Male
  • Interests:C++, video editing, games

Posted 02 September 2010 - 03:39 PM

View PostSaintJamesApostle, on 02 September 2010 - 03:52 AM, said:

I don't like much the "it works so why not used it" approach...
Other than this, the rest looks ok. Just a uint32 downcasted to uint8 for not particular reason as it seems.


Thats not my approach its only the printf useless thingie, the real deal is always made in pure perfection :)
more or less...
and Sadikum is right btw, just apply that one

x
Nature
0

#8 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 27 August 2011 - 09:33 AM

View PostSadikum, on 02 September 2010 - 01:29 PM, said:

Better to apply: http://arcemu.org/fo...showtopic=23077 it fix it by a better way and fix some other things.

Applied the linked patch instead of this one.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#9 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 27 August 2011 - 09:33 AM

This patch has been declined.
Your patch has probably been declined because it either is
1. A hacky fix
2. Not working properly
3. Outdated
4. Incomplete
5. Not a proper patch
Please refer to developer's notes before this post

Feel free to submit another patch when you've corrected/updated it.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users