From 177dacf1001ac69567d8fa37d36d076a06378b8b Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 16:09:02 +0200 Subject: [PATCH 1/4] Fixed: Compilation of Ryzom Installer --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/migratedialog.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h index 3c19bc6f4..9cd584372 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h @@ -17,8 +17,6 @@ #ifndef MIGRATEDIALOG_H #define MIGRATEDIALOG_H -#if defined(Q_OS_WIN32) || defined(Q_MOC_RUN) - #include "ui_migratedialog.h" /** @@ -50,5 +48,3 @@ private: }; #endif - -#endif From d8048eb352bacc347e697e7b00193bcdf8c40a66 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 16:10:03 +0200 Subject: [PATCH 2/4] Fixed: PCH after pull merge --HG-- branch : develop --- code/CMakeModules/PCHSupport.cmake | 38 +++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 92b76513b..37f413cbd 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -33,17 +33,29 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) SET(PCH_ARCHS) SET(_FLAGS) - LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS}) + # C++ flags + SET(_FLAG ${CMAKE_CXX_FLAGS}) + SEPARATE_ARGUMENTS(_FLAG) + + LIST(APPEND _FLAGS ${_FLAG}) + + # C++ config flags STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD) - LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}") + + SET(_FLAG ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}) + SEPARATE_ARGUMENTS(_FLAG) + + LIST(APPEND _FLAGS ${_FLAG}) GET_TARGET_PROPERTY(_targetType ${_target} TYPE) SET(_USE_PIC OFF) IF(${_targetType} STREQUAL "SHARED_LIBRARY" OR ${_targetType} STREQUAL "MODULE_LIBRARY") - LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") + SET(_FLAG ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) + SEPARATE_ARGUMENTS(_FLAG) + LIST(APPEND _FLAGS ${_FLAG}) ELSE() GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE) IF(_pic) @@ -53,7 +65,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES) FOREACH(item ${DIRINC}) - LIST(APPEND _FLAGS " -I\"${item}\"") + LIST(APPEND _FLAGS -I"${item}") ENDFOREACH() # NOTE: As cmake files (eg FindQT4) may now use generator expressions around their defines that evaluate @@ -92,18 +104,18 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) IF(oldProps) - LIST(APPEND _FLAGS " ${oldProps}") + LIST(APPEND _FLAGS ${oldProps}) ENDIF() GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) IF(oldPropsBuild) - LIST(APPEND _FLAGS " ${oldPropsBuild}") + LIST(APPEND _FLAGS ${oldPropsBuild}) ENDIF() GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES) IF(DIRINC) FOREACH(item ${DIRINC}) - LIST(APPEND _FLAGS " -I\"${item}\"") + LIST(APPEND _FLAGS -I"${item}") ENDFOREACH() ENDIF() @@ -130,7 +142,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) IF(_DIRS) FOREACH(item ${_DIRS}) - LIST(APPEND GLOBAL_DEFINITIONS " -I\"${item}\"") + LIST(APPEND GLOBAL_DEFINITIONS -I"${item}") ENDFOREACH() ENDIF() @@ -159,24 +171,21 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) ENDIF() IF(_USE_PIC) - LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIC}") + LIST(APPEND _FLAGS ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) ENDIF() ENDIF() IF(CMAKE_VERSION VERSION_LESS "3.3.0") GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS) GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS) - LIST(APPEND _FLAGS " ${_directory_flags}") - LIST(APPEND _FLAGS " ${_directory_definitions}") + LIST(APPEND _FLAGS ${_directory_flags}) + LIST(APPEND _FLAGS ${_directory_definitions}) ENDIF() # Format definitions IF(MSVC) # Fix path with space SEPARATE_ARGUMENTS(_FLAGS UNIX_COMMAND "${_FLAGS}") - ELSE() - STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS}) - SEPARATE_ARGUMENTS(_FLAGS) ENDIF() # Already in list form and items may contain non-leading spaces that should not be split on @@ -238,6 +247,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) ENDIF() IF(PCH_FLAGS) + LIST(REMOVE_ITEM PCH_FLAGS "") LIST(REMOVE_DUPLICATES PCH_FLAGS) ENDIF() ENDMACRO() From 6ff893421d099eb87da293b98d1bbcc28f66fb52 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 16:47:46 +0200 Subject: [PATCH 3/4] Changed: Specify Windows XP as minimum platform (we need that if using Windows 7 SDK with VC++ 2015) --HG-- branch : develop --- code/CMakeModules/nel.cmake | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index e06164570..7909c56b7 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -68,11 +68,30 @@ MACRO(NL_DEFAULT_PROPS name label) ENDIF(${type} STREQUAL SHARED_LIBRARY) IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) + # check if using a GUI + GET_TARGET_PROPERTY(_VALUE ${name} WIN32_EXECUTABLE) + + IF(TARGET_X64) + # Target Windows XP 64 bits + SET(_SUBSYSTEM_VERSION "5.02") + ELSE() + # Target Windows XP + SET(_SUBSYSTEM_VERSION "5.01") + ENDIF() + + IF(_VALUE) + # GUI + SET(_SUBSYSTEM "WINDOWS") + ELSE() + # Console + SET(_SUBSYSTEM "CONSOLE") + ENDIF() + SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} COMPILE_FLAGS "/GA" - LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}") + LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR} /SUBSYSTEM:${_SUBSYSTEM},${_SUBSYSTEM_VERSION}") ENDIF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW) ENDMACRO(NL_DEFAULT_PROPS) From 70be3a6093fea2e197e5c7c8e97a9c2f5af3e9dc Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 16:48:42 +0200 Subject: [PATCH 4/4] Changed: Merge pull request in develop too --HG-- branch : develop --- .../game_item_manager/game_item.cpp | 4 +-- .../game_item_manager/game_item.h | 6 ++-- .../combat_action_simple_dynamic_effect.cpp | 2 +- .../combat_action_simple_effect.cpp | 2 +- .../phrase_manager/combat_attacker.cpp | 8 +++--- .../phrase_manager/combat_attacker.h | 4 +-- .../phrase_manager/combat_phrase.cpp | 28 +++++++++++-------- .../phrase_manager/fg_prospection_phrase.cpp | 2 +- .../phrase_manager/magic_phrase.cpp | 6 ++-- .../phrase_manager/phrase_manager.cpp | 14 ++++++++-- .../phrase_manager/s_phrase.h | 6 ++-- .../phrase_manager/special_power_phrase.cpp | 2 +- .../phrase_manager/timed_action_phrase.cpp | 2 +- 13 files changed, 50 insertions(+), 36 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp index 390916885..11b612781 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp @@ -1085,7 +1085,7 @@ void CGameItem::resetEnchantment() _SapLoad = 0; _Enchantment.clear(); contReset( _Enchantment ); - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; if (getInventory() != NULL) getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_enchant)); @@ -1351,7 +1351,7 @@ void CGameItem::clear() _Destroyable = true; _Dropable = true; // _SlotImage = 0xFFFF; - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; // _Parent = NULL; _Inventory = NULL; _InventorySlot = INVENTORIES::INVALID_INVENTORY_SLOT; diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h index 635fbf74c..7f28cfe62 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/game_item.h @@ -651,9 +651,9 @@ public : bool getStats(const std::string &stats, std::string &final ); /// accessors to the action latency end date - inline NLMISC::TGameCycle getLatencyEndDate(){ return _LatencyEndDate; } + inline double getLatencyEndDate(){ return _LatencyEndDate; } - inline void setLatencyEndDate( NLMISC::TGameCycle latencyEndDate ){ _LatencyEndDate = latencyEndDate; } + inline void setLatencyEndDate( double latencyEndDate ){ _LatencyEndDate = latencyEndDate; } /// set the max sap load craft parameter inline void setMaxSapLoad(float value) @@ -950,7 +950,7 @@ private: /// string associated with this item std::string _PhraseId; /// tick when the proc will be available again - NLMISC::TGameCycle _LatencyEndDate; + double _LatencyEndDate; /// image of the item in bag / equipment // uint16 _SlotImage; NLMISC::TGameCycle _TotalSaleCycle; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_dynamic_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_dynamic_effect.cpp index 4b16d63e1..ea819763c 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_dynamic_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_dynamic_effect.cpp @@ -88,7 +88,7 @@ void CCombatActionDynamicEffect::applyOnEntity( CEntityBase *entity, float succe TGameCycle endDate; if ( _UsePhraseLatencyAsDuration == true && _CombatPhrase != 0) { - endDate = _CombatPhrase->latencyEndDate(); + endDate = (TGameCycle)_CombatPhrase->latencyEndDate(); } else { diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_effect.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_effect.cpp index e08633ccb..5155c37b1 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_effect.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_action_simple_effect.cpp @@ -88,7 +88,7 @@ void CCombatActionSimpleEffect::applyOnEntity( CEntityBase *entity, float succes TGameCycle endDate; if ( _UsePhraseLatencyAsDuration == true && _CombatPhrase != 0) { - endDate = _CombatPhrase->latencyEndDate(); + endDate = (TGameCycle)_CombatPhrase->latencyEndDate(); } else { diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp index f6c2cdb85..9ab1925bd 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp @@ -130,7 +130,7 @@ CCombatWeapon::CCombatWeapon(CGameItemPtr itemPtr) // weapon hit rate is in hit/10s and we use ticks/hits.... if (itemPtr->hitRate() != 0) { - LatencyInTicks = uint16( (10.0f / itemPtr->hitRate()) / CTickEventHandler::getGameTimeStep()); + LatencyInTicks = (10.0 / itemPtr->hitRate()) / CTickEventHandler::getGameTimeStep(); } Quality = (uint16)itemPtr->recommended(); @@ -297,7 +297,7 @@ void CCombatAttackerAI::initFromRowId( const TDataSetRow &rowId ) _RightHandWeapon.Damage = (float)form->getCreatureDamagePerHit() * BotDamageFactor; _RightHandWeapon.DmgType = DMGTYPE::SLASHING; - _RightHandWeapon.LatencyInTicks = (uint16)form->getAttackLatency(); + _RightHandWeapon.LatencyInTicks = (double)form->getAttackLatency(); _RightHandWeapon.Family = ITEMFAMILY::MELEE_WEAPON; _RightHandWeapon.Skill = BarehandCombatSkill; _RightHandWeapon.SabrinaCost = (uint16)_SkillValue; @@ -416,7 +416,7 @@ void CCombatAttackerNpc::initFromRowId( const TDataSetRow &rowId ) { // get speed, dmg type, skill and family _RightHandWeapon = CCombatWeapon(entity->getRightHandItem()); - _RightHandWeapon.LatencyInTicks = (uint16)form->getAttackLatency(); + _RightHandWeapon.LatencyInTicks = (double)form->getAttackLatency(); // check ammo if (entity->getAmmoItem() != NULL && entity->getAmmoItem()->getStaticForm() != NULL && entity->getAmmoItem()->getStaticForm()->Family == ITEMFAMILY::AMMO) @@ -426,7 +426,7 @@ void CCombatAttackerNpc::initFromRowId( const TDataSetRow &rowId ) } else { - _RightHandWeapon.LatencyInTicks = (uint16)form->getAttackLatency(); + _RightHandWeapon.LatencyInTicks = (double)form->getAttackLatency(); _RightHandWeapon.Family = ITEMFAMILY::MELEE_WEAPON; _RightHandWeapon.Skill = BarehandCombatSkill; _RightHandWeapon.DmgType = DMGTYPE::BLUNT; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h index e5e9baa82..02f0f39f8 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.h @@ -92,7 +92,7 @@ public: /************************************************************************/ /* do not forget to update the operator= if attributes change /************************************************************************/ - uint16 LatencyInTicks; + double LatencyInTicks; float Damage; uint16 Quality; DMGTYPE::EDamageType DmgType; @@ -111,7 +111,7 @@ public: private: void init() { - LatencyInTicks = 0; + LatencyInTicks = 0.0; Damage = 0; Quality = 0; DmgType = DMGTYPE::UNDEFINED; diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp index 0e34f243f..924c3b0f9 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_phrase.cpp @@ -382,7 +382,7 @@ void CCombatPhrase::init() _CriticalHit = false; _ExecutionEndDate = 0; - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; _SabrinaCost = 0; _SabrinaRelativeCost = 1.0f; @@ -892,7 +892,7 @@ bool CCombatPhrase::evaluate() _NotEnoughStaminaMsg = false; _NotEnoughHpMsg = false; _DisengageOnEnd = false; - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; _ExecutionEndDate = 0; return true; @@ -1702,7 +1702,7 @@ bool CCombatPhrase::launch() { H_AUTO(CCombatPhrase_launch); - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; _ApplyDate = 0; if ( !_Attacker ) @@ -1843,14 +1843,14 @@ bool CCombatPhrase::launch() } // get weapon latency - float latency; + double latency; if(_LeftWeapon.LatencyInTicks != 0) { - latency = float(_HitRateModifier + std::max( MinTwoWeaponsLatency.get(), std::max(_RightWeapon.LatencyInTicks, _LeftWeapon.LatencyInTicks)) + _Ammo.LatencyInTicks); + latency = double(_HitRateModifier + std::max( double(MinTwoWeaponsLatency.get()), std::max(_RightWeapon.LatencyInTicks, _LeftWeapon.LatencyInTicks)) + _Ammo.LatencyInTicks); } else { - latency = float(_HitRateModifier + std::max(_RightWeapon.LatencyInTicks, _LeftWeapon.LatencyInTicks) + _Ammo.LatencyInTicks); + latency = double(_HitRateModifier + std::max(_RightWeapon.LatencyInTicks, _LeftWeapon.LatencyInTicks) + _Ammo.LatencyInTicks); } // check for madness effect @@ -2177,8 +2177,14 @@ bool CCombatPhrase::launch() // set latency end date const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle(); - _LatencyEndDate = time + (NLMISC::TGameCycle)latency; - + if (_LatencyEndDate > 0) + { + _LatencyEndDate += latency; + } + else + { + _LatencyEndDate = (double)time + latency; + } // compute the apply date if (_Targets[0].Target!=NULL && actingEntity->getEntityRowId() == _Targets[0].Target->getEntityRowId()) { @@ -2322,8 +2328,8 @@ bool CCombatPhrase::launchAttack(CEntityBase * actingEntity, bool rightHand, boo // now we use the weapon speed factor as a divisor of wear per action // (a weapon twice as fast will wear twice as slow) nlassert(ReferenceWeaponLatencyForWear > 0); - const uint16 latency = (rightHand ? _RightWeapon.LatencyInTicks : _LeftWeapon.LatencyInTicks); - const float wearFactor = (float)latency / (float)ReferenceWeaponLatencyForWear; + const float latency = (rightHand ? _RightWeapon.LatencyInTicks : _LeftWeapon.LatencyInTicks); + const float wearFactor = latency / (float)ReferenceWeaponLatencyForWear; if (rightHand) { @@ -3365,7 +3371,7 @@ void CCombatPhrase::stop() CCharacter *character = PlayerManager.getChar(_Attacker->getEntityRowId()); if (character) { - character->dateOfNextAllowedAction( _LatencyEndDate ); + character->dateOfNextAllowedAction((NLMISC::TGameCycle)_LatencyEndDate ); } } diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp index b45a6043d..cd153c5ad 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/fg_prospection_phrase.cpp @@ -716,7 +716,7 @@ void CFgProspectionPhrase::apply() MBEHAV::CBehaviour behav = player->getBehaviour(); // keep arguments behav.Behaviour = MBEHAV::PROSPECTING_END; PHRASE_UTILITIES::sendUpdateBehaviour( _ActorRowId, behav ); - _LatencyEndDate = ForageSourceSpawnDelay.get(); // wait a short time before spawning the source(s) (to let animation/fx time) + _LatencyEndDate = (double)ForageSourceSpawnDelay.get(); // wait a short time before spawning the source(s) (to let animation/fx time) } diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp index 16f77bc8b..8895f48b9 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/magic_phrase.cpp @@ -1566,9 +1566,9 @@ bool CMagicPhrase::launch() // add post cast latency, only for non instant cast const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle(); if (_DivineInterventionOccured||_ShootAgainOccured?_BaseCastingTime:_CastingTime) - _LatencyEndDate = time + PostCastLatency + _PostCastTime; + _LatencyEndDate = (double)time + PostCastLatency + _PostCastTime; else - _LatencyEndDate = 0 + _PostCastTime; + _LatencyEndDate = 0.0 + _PostCastTime; // compute the apply date if ( !_Targets.empty() && _ActorRowId != _Targets[0].getId()) @@ -1898,7 +1898,7 @@ void CMagicPhrase::enchantPhrase(CCharacter * user,float successFactor) _Targets.resize(1); // user->setActionFlag( RYZOMACTIONFLAGS::Attacks, true ); - _LatencyEndDate = 0;//time + _HitRateModifier + weapon.LatencyInTicks + ammo.SpeedInTicks ; + _LatencyEndDate = 0.0;//time + _HitRateModifier + weapon.LatencyInTicks + ammo.SpeedInTicks ; // _BeingProcessed = false; } // enchantPhrase // diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp index 84e68dcd1..cf6581464 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp @@ -456,7 +456,15 @@ void CPhraseManager::updatePhrases() } // update this phrase - updateEntityCurrentAction( (*it).first, entityPhrases); + CSPhrase::TPhraseState old_state; + do + { + old_state = phrase->state(); + updateEntityCurrentAction( (*it).first, entityPhrases); + phrase = entityPhrases.getCurrentAction(); + //Every time we get the next action, th phrase might be deleted (if the action is invalid or finished for non-cyclic actions like digging / crafting), always check ! + } + while(phrase != NULL && old_state != phrase->state()); // get next entity sentences ++it; @@ -466,7 +474,7 @@ void CPhraseManager::updatePhrases() sendEventReports(); // sendAIEvents(); -} +} // updatePhrases() //-------------------------------------------------------------- // updateEntityCurrentAction() @@ -703,7 +711,7 @@ afterPhraseProcessing: // go to next action for this entity entityPhrases.goToNextAction(); } -} // updatePhrases // +} // updateEntityCurrentAction // //----------------------------------------------- diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/s_phrase.h b/code/ryzom/server/src/entities_game_service/phrase_manager/s_phrase.h index 01cd8ec7c..3edff92ad 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/s_phrase.h +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/s_phrase.h @@ -56,7 +56,7 @@ public: _Idle = false; _ExecutionEndDate = 0; _ApplyDate = ~0; // ensure apply() never called before launch() - _LatencyEndDate = 0; // by default, time between apply() and end() is immediate + _LatencyEndDate = 0.0; // by default, time between apply() and end() is immediate _PhraseBookIndex = 0; _NextCounter = 0; _IsStatic = false; @@ -98,7 +98,7 @@ public: inline NLMISC::TGameCycle applyDate() const { return _ApplyDate; } /// get latency end date - inline NLMISC::TGameCycle latencyEndDate() const { return _LatencyEndDate; } + inline double latencyEndDate() const { return _LatencyEndDate; } /** * build the phrase from bricks, actor and main target @@ -207,7 +207,7 @@ protected: /// apply date NLMISC::TGameCycle _ApplyDate; /// latency end date - NLMISC::TGameCycle _LatencyEndDate; + double _LatencyEndDate; /// index in client phrase book (0 = not in the phrase book) uint16 _PhraseBookIndex; /// next counter diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp index 84d4d31fb..7e24f427e 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/special_power_phrase.cpp @@ -758,7 +758,7 @@ bool CSpecialPowerPhrase::launch() //----------------------------------------------- void CSpecialPowerPhrase::apply() { - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; // TODO // apply effect diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/timed_action_phrase.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/timed_action_phrase.cpp index 1537a0ca4..8a1ba51fc 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/timed_action_phrase.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/timed_action_phrase.cpp @@ -279,7 +279,7 @@ void CTimedActionPhrase::apply() // keep a ptr on this to prevent it to be deleted when timed action is deconnection CSPhrasePtr selfPtr = this; - _LatencyEndDate = 0; + _LatencyEndDate = 0.0; CEntityBase *actor = CEntityBaseManager::getEntityBasePtr(_ActorRowId); if (!actor)