void Muzzleflasher::createMuzzleflash(IPointableObject *unit, VisualObject *muzzleflash, const std::string &name, const std::string &helper) { // WARNING: unsafe cast! game::Unit *u = (game::Unit *)unit; VisualObject *vo = u->getVisualObject(); vo->combine(muzzleflash, name.c_str(), helper.c_str()); }
void Muzzleflasher::createMuzzleflash(IPointableObject *unit, VisualObject *muzzleflash, int muzzleFlashBarrelNumber) { // WARNING: unsafe cast! game::Unit *u = (game::Unit *)unit; std::string barrelName = "WeaponBarrel"; if (muzzleFlashBarrelNumber >= 2) barrelName += int2str(muzzleFlashBarrelNumber); std::string modelHelperName = std::string("HELPER_MODEL_") + barrelName; const char *weaponHelper = modelHelperName.c_str(); //char *weaponHelper = "HELPER_MODEL_WeaponBarrel"; VisualObject *vo = u->getVisualObject(); vo->combine(muzzleflash, "muzzleflash", weaponHelper); }