mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-30 15:01:29 +00:00
Fix for perl not loading events if they're chained, fix for items not being removed from inventory at an intuitive time in event_trade
This commit is contained in:
parent
a5db4310c6
commit
945cc2117f
@ -366,11 +366,6 @@ void PerlembParser::LoadNPCScript(std::string filename, int npc_id) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto iter = npc_quest_status_.find(npc_id);
|
||||
if(iter != npc_quest_status_.end()) {
|
||||
return;
|
||||
@ -396,11 +391,6 @@ void PerlembParser::LoadGlobalNPCScript(std::string filename) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(global_npc_quest_status_ != questUnloaded) {
|
||||
return;
|
||||
}
|
||||
@ -425,11 +415,6 @@ void PerlembParser::LoadPlayerScript(std::string filename) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(player_quest_status_ != questUnloaded) {
|
||||
return;
|
||||
}
|
||||
@ -454,11 +439,6 @@ void PerlembParser::LoadGlobalPlayerScript(std::string filename) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(global_player_quest_status_ != questUnloaded) {
|
||||
return;
|
||||
}
|
||||
@ -486,11 +466,6 @@ void PerlembParser::LoadItemScript(std::string filename, ItemInst *item) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto iter = item_quest_status_.find(item->GetID());
|
||||
if(iter != item_quest_status_.end()) {
|
||||
return;
|
||||
@ -519,11 +494,6 @@ void PerlembParser::LoadSpellScript(std::string filename, uint32 spell_id) {
|
||||
if(!perl)
|
||||
return;
|
||||
|
||||
if(perl->InUse())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto iter = spell_quest_status_.find(spell_id);
|
||||
if(iter != spell_quest_status_.end()) {
|
||||
return;
|
||||
|
||||
@ -255,7 +255,7 @@ void Embperl::eval_file(const char * packagename, const char * filename)
|
||||
std::vector<std::string> args;
|
||||
args.push_back(packagename);
|
||||
args.push_back(filename);
|
||||
dosub("eval_file", &args);
|
||||
dosub("main::eval_file", &args);
|
||||
}
|
||||
|
||||
void Embperl::dosub(const char * subname, const std::vector<std::string> * args, int mode)
|
||||
@ -303,7 +303,7 @@ void Embperl::eval(const char * code)
|
||||
std::vector<std::string> arg;
|
||||
arg.push_back(code);
|
||||
// MYRA - added EVAL & KEEPERR to eval per Eglin's recommendation
|
||||
dosub("my_eval", &arg, G_SCALAR|G_DISCARD|G_EVAL|G_KEEPERR);
|
||||
dosub("main::my_eval", &arg, G_SCALAR|G_DISCARD|G_EVAL|G_KEEPERR);
|
||||
//end Myra
|
||||
}
|
||||
|
||||
|
||||
@ -644,13 +644,17 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer)
|
||||
if(tradingWith->GetAppearance() != eaDead) {
|
||||
tradingWith->FaceTarget(this);
|
||||
}
|
||||
|
||||
|
||||
ItemInst *insts[4] = { 0 };
|
||||
for(int i = 3000; i < 3004; ++i) {
|
||||
insts[i - 3000] = m_inv.PopItem(i);
|
||||
}
|
||||
|
||||
parse->EventNPC(EVENT_TRADE, tradingWith->CastToNPC(), this, "", 0, &item_list);
|
||||
|
||||
for(int i = 3000; i < 3004; ++i) {
|
||||
ItemInst *inst = m_inv.GetItem(i);
|
||||
if(inst) {
|
||||
DeleteItemInInventory(i);
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if(insts[i]) {
|
||||
safe_delete(insts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user