Ok, I am trying to apply a patch to mangos and keep getting errors. I decide to try and patch manually, however; I'm a noob when it comes to these things. I was wondering if someone could assist me with understanding the diff file and exactly how to read it.
This is a section of the patch:
[== c++ ==]
diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 7035efb..1616211 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -258,7 +258,6 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(itemid);
if (!itemProto)
return false;
-
SetUInt32Value(ITEM_FIELD_STACK_COUNT, 1);
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, itemProto->MaxDurability);
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
This is the file segment:
[== c++ ==]
bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
{
Object::_Create(guidlow, 0, HIGHGUID_ITEM);
SetEntry(itemid);
SetObjectScale(DEFAULT_OBJECT_SCALE);
SetGuidValue(ITEM_FIELD_OWNER, owner ? owner->GetObjectGuid() : ObjectGuid());
SetGuidValue(ITEM_FIELD_CONTAINED, ObjectGuid());
ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(itemid);
if (!itemProto)
return false;
SetUInt32Value(ITEM_FIELD_STACK_COUNT, 1);
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, itemProto->MaxDurability);
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
SetUInt32Value(ITEM_FIELD_DURATION, itemProto->Duration);
return true;
}
Two questions I need answered in order completely understand patch/diff files. First, @@ -258,7 +258,6 @@, I understand those mean (start,count) though I couldn't find anything on what exactly the count means. Second, with the above example, which line(s) would be removed from the file? Would it only be the blank line or all 3 of the SetUInt32's as well?
I appreciate any and all help that you guys can give me on this. If I happened to post this in the wrong forum, I apologize and ask that a mod move it to the correct forum.