Since they should work like the pawn weapons did, they should only be able to be attached once.
A possible fix would be to replace the ATTACHACCESSORY case in CPawnHigh.cpp with
Code: Select all
case ATTACHACCESSORY:
{
geActor *MasterActor = NULL;
std::string EntityName;
if(!EffectC_IsStringNull(Object->Index->TriggerName))
{
EntityName = Object->Index->TriggerName;
if(!stricmp(Object->Index->TriggerName, "Player"))
MasterActor = CCD->Player()->GetActor();
else
MasterActor = CCD->ActorManager()->GetByEntityName(Object->Index->TriggerName);
}
else
{
EntityName = CCD->ActorManager()->GetEntityName(Object->Actor);
MasterActor = Object->Actor;
}
if(MasterActor)
{
unsigned int keynum = AccessoryCache.size();
if(keynum>0)
{
for(unsigned int i=0; i<keynum; i++)
{
if(!strcmp(AccessoryCache[i].Name.c_str(), Object->Index->AnimName))
{
EntityName += Object->Index->AnimName;
//Look if we already have this accessory
geActor *SlaveActor = CCD->ActorManager()->GetByEntityName(EntityName.c_str());
if(SlaveActor) //Pawn already has this accessory, don't add twice
break;
SlaveActor = CCD->ActorManager()->SpawnActor(AccessoryCache[i].ActorName,
Object->Location, AccessoryCache[i].Rotation, "", "", NULL);
if(!SlaveActor)
break;
CCD->ActorManager()->SetEntityName(SlaveActor, EntityName.c_str());
if(AccessoryCache[i].EnvironmentMapping)
SetEnvironmentMapping( SlaveActor, true,
AccessoryCache[i].AllMaterial,
AccessoryCache[i].PercentMapping,
AccessoryCache[i].PercentMaterial);
CCD->ActorManager()->ActorAttachBlend(SlaveActor, MasterActor);
break;
}
}
}
}
Object->ActionActive = false;
runflag = true;
break;
}