Thread: OP Code issue
View Single Post
  #5  
Old 11-06-2010, 12:14 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

The OP_InterruptCast error from npc's comes from
Code:
void Mob::InterruptSpell(int16 message, int16 color, int16 spellid) in spells.cpp
the line
Code:
	outapp = new EQApplicationPacket(OP_InterruptCast, sizeof(InterruptCast_Struct) + strlen(GetCleanName()) + 1);
sends the npc's name + 1
but the encode uses the define for exact size of the InterruptCast_Struct
Code:
ENCODE(OP_InterruptCast) {
	ENCODE_LENGTH_EXACT(InterruptCast_Struct);
	SETUP_DIRECT_ENCODE(InterruptCast_Struct, structs::InterruptCast_Struct);
	OUT(spawnid);
	OUT(messageid);
	FINISH_ENCODE();
}
when adding the name to the size might make it fail. Maybe it should use
Code:
ENCODE(OP_InterruptCast) {
	ENCODE_LENGTH_ATLEAST(InterruptCast_Struct);
	SETUP_DIRECT_ENCODE(InterruptCast_Struct, structs::InterruptCast_Struct);
	OUT(spawnid);
	OUT(messageid);
	FINISH_ENCODE();
}
__________________
The Realm
Reply With Quote