Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Call of Chernobyl 1.4.22 (#1529) #1708

Merged
merged 197 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
c250e84
+ changed cp command to copy
avoitishin Dec 10, 2014
0736875
* Possible to do interactive debug of the game
avoitishin Dec 12, 2014
cb17849
+ Sun direction fix (http://www.gameru.net/forum/index.php?showtopic=…
avoitishin Dec 13, 2014
84c7bde
+ sky box stretch fix
avoitishin Dec 13, 2014
da0f834
+ added new parameter -nologo to skip NVIDIA and other videos in game…
avoitishin Dec 13, 2014
34384ec
+ working release config (does not include plugins, editor, utils)
avoitishin Dec 13, 2014
78afdb5
+ change nologo start up param to skiplogo as it was clashing with nolog
avoitishin Dec 14, 2014
bdf5373
+ Actor hit script callback
avoitishin Dec 16, 2014
00e48d5
+ fix "cannot find rank for" bug (restrictions.cpp)
avoitishin Dec 16, 2014
e9dc027
+ log1 script command
avoitishin Dec 17, 2014
b57cdf9
+ exposed lua debug library (under -dbg key)
avoitishin Dec 17, 2014
96699eb
* luajit 1.1.8 currently not working correctly
avoitishin Dec 18, 2014
9af385d
+ exposed lua debug library (under -dbg key)
avoitishin Dec 17, 2014
9954a35
! rolled back lua debug library due to some bug. Need to check in future
avoitishin Dec 18, 2014
fc98b97
+ LuaJIT-1.1.8 is now fully functional
avoitishin Dec 18, 2014
7e6fdc0
* fixed lua debug export (requires -dbg key)
avoitishin Dec 18, 2014
e1c873a
Merge branch 'luajit' into working
avoitishin Dec 18, 2014
e8aef59
! increased LUAI_MAXCSTACK and LUAL_BUFFERSIZE values
avoitishin Dec 18, 2014
e140049
+ debug config for LuaJIT-1.1.8 project
avoitishin Dec 18, 2014
9273234
Core:
avoitishin Dec 19, 2014
cb83ca8
Update README.md
avoitishin Dec 20, 2014
3413cee
Update README.md
avoitishin Dec 20, 2014
2972f1d
Update README.md
avoitishin Dec 20, 2014
99be996
Update README.md
avoitishin Dec 20, 2014
7c47e46
Update README.md
avoitishin Dec 20, 2014
c2218e3
Update README.md
avoitishin Dec 20, 2014
9b65f22
Merge branch 'master' of https://github.com/avoitishin/xray-16
avoitishin Dec 20, 2014
2473694
README.md updates
avoitishin Dec 20, 2014
8ec5ce3
Update README.md
avoitishin Dec 20, 2014
07210fc
Update README.md
avoitishin Dec 20, 2014
f542c95
~ changed first person death to star game_over tutorial
avoitishin Dec 21, 2014
e60e2fb
* fix issue when values were not updated (silently skipped) when same…
avoitishin Dec 22, 2014
d6dc1bd
* made BugTrap optional (enable in build_config_defines.h). This is v…
avoitishin Dec 23, 2014
363a75d
* lua debug library does not require -dbg key anymore
avoitishin Dec 24, 2014
fc35ebb
* lua debug is now enabled in both debug build and release build with…
avoitishin Dec 24, 2014
f203002
Merge branch 'working'
avoitishin Dec 25, 2014
509f52e
+ Added sanity checks to a couple actions that should verify if enemy…
revolucas Dec 25, 2014
629a268
Merged @Revolucas (Alundaio) changes
avoitishin Dec 29, 2014
a665139
* changed out folders for Debug (bin_dbg) and Release (bin_rel)
avoitishin Dec 29, 2014
6dda126
+ added alife().jump_to_level
revolucas Dec 27, 2014
4d7d004
+ Now pass game object of initiator using a door to ph_door:use_callback
revolucas Dec 28, 2014
c9121c5
+ added the ability to reload system ini through lua script via the n…
revolucas Dec 29, 2014
43e2a0f
* fix teleport_object
revolucas Dec 29, 2014
382bf9b
+ commented few VERIFY statements to make COC run in Debug
avoitishin Dec 30, 2014
acbf8ec
+ new config define LUA_DEBUG_PRINT to turn on script_engine().script…
avoitishin Dec 30, 2014
416c786
* fix for previous commit (forgot to change debug checks)
avoitishin Dec 30, 2014
a73f33f
* fix for previous commit (forgot to change debug checks)
avoitishin Dec 30, 2014
5462a9d
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Dec 31, 2014
216c110
- removed -dbg requirement for lua logs
revolucas Dec 31, 2014
d459536
* more VERIFY calls tweaks to allow mods run in Debug
avoitishin Jan 1, 2015
8b81494
* Altered the existing net_packet:r_begin(number) export to be net_pa…
revolucas Jan 2, 2015
18f7efe
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Jan 2, 2015
5c51a80
+ SPAWN_ANTIFREEZE implementation from alpet
avoitishin Jan 2, 2015
4baec3b
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
avoitishin Jan 2, 2015
7a77434
+ non fatal verify (with NON_FATAL_VERIFY define)
avoitishin Jan 2, 2015
01971d7
* fixed r_begin to return u32
avoitishin Jan 2, 2015
dc72468
ECO RENDER
Jan 2, 2015
0670ddb
+ detail draw radius console setting (r__detail_radius)
avoitishin Jan 2, 2015
9509d19
+ ECO_RENDER define to restrict FPS in menu and videos and prevent vi…
avoitishin Jan 2, 2015
f245140
+Actor shadow added
CasualDev242 Jan 3, 2015
58b2242
Forgot all of IsActorOutdoors function
CasualDev242 Jan 3, 2015
ad1218c
lua extensions:
avoitishin Jan 4, 2015
191bc8b
Merge remote-tracking branch 'remotes/swartz/swartz-working' into wor…
avoitishin Jan 4, 2015
78b92b4
* bug fixes for previous commit
avoitishin Jan 5, 2015
8bc50bb
* fixed fast animation switches with GL
avoitishin Jan 5, 2015
ae54aa5
+ initial framework for misfire sounds and animations (aka gunslinger)
avoitishin Jan 5, 2015
9307c4c
* added ability to check for existence of 3rd person animations
avoitishin Jan 5, 2015
67d3b01
+ players class diagram
avoitishin Jan 5, 2015
42b25c6
+ added weapon_addon_attach and weapon_addon_detach exports (not work…
revolucas Jan 6, 2015
234b69e
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Jan 6, 2015
7087aa2
+ print_stack is exported to global namespace
avoitishin Jan 11, 2015
a35505e
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Jan 11, 2015
c32556f
+ added the ability to define phantom_section in configs for psy_dog …
revolucas Jan 12, 2015
3b0dec0
* debug config for lua-extensions
avoitishin Jan 12, 2015
42f5c21
+ vsync by avbaula (enabled by VSYNC_FIX)
avoitishin Jan 12, 2015
6d4912d
* changed log1 to log
avoitishin Jan 13, 2015
3bf8cd0
+ initial setup of luajit-2.0.3 (need some more work plus smart_terra…
avoitishin Jan 13, 2015
c9ccc07
* fixed lua-extensions project
avoitishin Jan 13, 2015
2e72ecc
* commented out LUA_DEBUG_PRINT as redundant. It is now deprecated an…
avoitishin Jan 13, 2015
badd570
* LuaJit 2+ can is now fully functional
avoitishin Jan 14, 2015
6a7753c
+ added luajit dlls, exp, lib, and exe to source control
avoitishin Jan 14, 2015
dd39d68
* updated luajit to v2.1-alpha
avoitishin Jan 14, 2015
d91c100
- added some -dbg logging
revolucas Jan 16, 2015
195379f
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Jan 16, 2015
773c53f
+ Updated several combat actions with an "abs(y1-y2) > 3.0f" check fo…
revolucas Jan 16, 2015
1369d49
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
avoitishin Jan 17, 2015
d9f0a9b
= Improved the 'stalker don't stare through ceiling/floor' feature. I…
revolucas Jan 17, 2015
fc4a70f
Merge branch 'working' of https://github.com/avoitishin/xray-16 into …
revolucas Jan 17, 2015
337ace5
* lua re-org:
avoitishin Jan 17, 2015
46e3fc0
* lua re-org part 2:
avoitishin Jan 18, 2015
7b299fd
Merge branch 'working' of https://github.com/revolucas/xray-16 into l…
avoitishin Jan 18, 2015
d62dace
~ more warnings cleanup
avoitishin Jan 18, 2015
897d929
+ added level namespace export level.spawn_item(section,position,leve…
revolucas Jan 18, 2015
29d882b
= fix for SPAWN_ANTIFREEZE crashes caused by rapid online-offline switch
avoitishin Jan 18, 2015
0d668a3
Merge branch 'working' of https://github.com/revolucas/xray-16 into l…
avoitishin Jan 18, 2015
6f60d47
+ restored config defined sun movement (toggle with define DYNAMIC_SU…
avoitishin Jan 20, 2015
125bd5d
= fix for issue #13
avoitishin Jan 21, 2015
1fae762
= another attempt to fix spawn antifreeze
avoitishin Jan 21, 2015
a0fcf1d
= fix for previous commit (rolled back changes to spawn antifreeze)
avoitishin Jan 21, 2015
2f9bc05
+ diagrams project stub
avoitishin Jan 25, 2015
2f17779
Merge branch 'luajit_cleanup' into working
avoitishin Jan 25, 2015
55364e8
Merge branch 'luajit_cleanup' into luajit2
avoitishin Jan 25, 2015
f9e29b2
* fix npcs getting stuck in action_take_cover
revolucas Jan 26, 2015
39b12f9
Merge branch 'luajit_cleanup' of https://github.com/avoitishin/xray-1…
revolucas Jan 26, 2015
2eefc2a
Merge branch 'luajit_cleanup' into working
revolucas Jan 26, 2015
fa27ded
Merge remote-tracking branch 'remotes/alundaio/working' into luajit2
avoitishin Feb 1, 2015
8202cb2
+ actor_before_death script call back (set in bind_stalker). This wil…
avoitishin Feb 2, 2015
011e075
+ actor_before_death script call back (set in bind_stalker). This wil…
avoitishin Feb 2, 2015
608a9ec
+ tree amplitude (sway amount) aka LA. For best visuals, set tree_amp…
avoitishin Feb 2, 2015
eedaded
* changed cycle down in WeaponMagazined.cpp
revolucas May 20, 2015
21c3f6d
- removed Proposed engine changes.txt
revolucas May 21, 2015
c27e821
Update README.md
revolucas May 21, 2015
76a8b38
= fix for on_actor_before_death callback to kill actor in the res/gam…
revolucas May 21, 2015
759ab62
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
revolucas May 21, 2015
be5fb0d
~ changed res bind_stalker.script
revolucas May 21, 2015
b9ac422
+ res\gamedata added Actor and Grass Shadow options
revolucas May 21, 2015
db3dc0e
= fix to res/gamedata/scripts/bind_stalker.script of a line that shou…
revolucas May 21, 2015
504dd46
Update README.md
revolucas May 24, 2015
a47a865
= Consumables greater then 1x1 inv_grid_width will no longer crash th…
revolucas Jun 3, 2015
5f6fc78
~ reverted change to inside_anomaly
revolucas Jun 3, 2015
7213550
= fix rpm for abakan cycle down
revolucas Jun 3, 2015
6a7142f
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
revolucas Jun 3, 2015
6d79c2b
+ Restored method to attach vehicle to actor
revolucas Jun 13, 2015
924dc71
~ reverted changes done to SPAWN_ANTIFREEZE due to issues with it (un…
revolucas Jun 17, 2015
33f4817
+ Teleport actor to demo cam when you press Enter while in demo_record
revolucas Jun 21, 2015
c3f8336
* restructured many features behind defines (see: build_config_define…
revolucas Jul 7, 2015
0bd6b0f
Added functionality for multiple item usage
AxelDominatoR Aug 13, 2015
d02fee1
Disable some logging
AxelDominatoR Aug 13, 2015
c261086
* restructured many features behind defines (see: build_config_define…
revolucas Jul 7, 2015
9148ab6
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
revolucas Aug 19, 2015
92d3ee8
Merge pull request #1 from AxelDominatoR/working
revolucas Aug 19, 2015
41c1d79
Merge pull request #1 from revolucas/working
AxelDominatoR Aug 19, 2015
1ee6eb0
= fixed inventory cell items not updating progress bar
revolucas Aug 22, 2015
92b9234
= fixed inventory cell items not updating progress bar
revolucas Aug 22, 2015
529ee68
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
revolucas Aug 22, 2015
c835abc
Various fixes plus progress bars are now green
AxelDominatoR Aug 22, 2015
9f0f205
Merge branch 'working' of https://github.com/AxelDominatoR/xray-16 in…
revolucas Aug 22, 2015
1fac6e0
~ polished some minor quirks with consumables due to new use_conditio…
revolucas Aug 22, 2015
0f8adad
~ moved some consumables code out of eatable_item.cpp UseBy into inve…
revolucas Aug 23, 2015
d15d971
+ AxelDominator weight calculations for CEatableItem weight
revolucas Aug 27, 2015
818bfaa
+ added code to donate item through context menu during trade (Work i…
revolucas Aug 28, 2015
ca40e5c
~ further improved the new non-slot equip mechanic. slot_persistent =…
revolucas Aug 28, 2015
b6f4518
= fixed stacking issue with non-slot equip feature but equip when ite…
revolucas Aug 28, 2015
c7d1a15
+ added decay_rate for detectors when use_condition = true. on animat…
revolucas Aug 29, 2015
f95126b
~ added PDA_SLOT and TORCH_SLOT to list
revolucas Aug 29, 2015
a895134
= fixed fuzzy font in DX11
revolucas Sep 20, 2015
fc79d96
+ re-enabled AI dying in anomalies. ai_die_in_anomaly console command…
revolucas Sep 23, 2015
1c5c0ea
= res/gamedata/configs/misc/items.ltx added the new fields with defau…
revolucas Sep 24, 2015
e0fa75f
= fix volumetric lighting in DX11
revolucas Oct 2, 2015
c5085c5
- removed ai_die_in_anomaly as it causes severe AI detection issues
revolucas Oct 2, 2015
658f68a
+ new game object exports (see wiki: https://github.com/revolucas/xra…
revolucas Oct 8, 2015
f2b926f
+ raypick.cpp
revolucas Oct 8, 2015
5a1daf6
- reverted actor condition exports
revolucas Oct 9, 2015
f2ea751
= Workaround for invalid vertex for object
revolucas Jan 14, 2016
46c1c78
+ added new exported game_object methods for weapons:
revolucas Feb 26, 2016
1a206d7
+ exports for game_objects: set_weight, use, start_trade, start_upgrade
revolucas Apr 12, 2016
3053cf0
+ Added cut-content AmebaZone
revolucas May 29, 2016
0b7bb5c
+ AI are now effected by Anomalies inherited from CCustomZone
revolucas May 31, 2016
117a949
- remove ai_die_in_anomaly console command
revolucas Jun 1, 2016
b09fd23
- remove ai_die_in_anomaly console command
revolucas Jun 1, 2016
7ae9c60
Merge branch 'working' of https://github.com/revolucas/xray-16 into w…
revolucas Jun 1, 2016
6004172
+ added ai_die_in_anomaly via space_restrictor.cpp (again)
revolucas Jun 1, 2016
a12d8b0
= fix third person camera
revolucas Jun 1, 2016
6b1773a
+ added set_restrictor_type and get_restrictor_type game_object metho…
revolucas Jun 2, 2016
f32629e
= fixed some warnings by PVS Studio
revolucas Jun 21, 2016
67867d6
= fix rain
revolucas Jul 9, 2016
a74284a
+ now disable the use of precompiled shaders by default. Can be re-en…
revolucas Jul 11, 2016
ccdac10
+ Optional snd_shoot_actor and snd_silencr_shot_actor sounds (can be …
revolucas Jul 12, 2016
4b155c6
~ last commit
revolucas Jul 12, 2016
ef38dca
~ inifile changes
revolucas Jul 15, 2016
9de4ee5
- disabled some compiler security features which should improve game …
revolucas Jul 22, 2016
ebb4886
+ snd_explode is now a layered sound collection
revolucas Jul 30, 2016
6b0c37b
~ changed splash screen
revolucas Aug 10, 2016
54d589a
~ reverted changes to rain
revolucas Aug 10, 2016
1bc0e67
= No longer display weapon params for melee weapons (check for ammo = 0)
revolucas Aug 10, 2016
cdd0ef2
~ I will amend this commit message later
revolucas Aug 31, 2016
06ea42c
~ display condition in Artefact UI stat info (for degradation)
revolucas Sep 7, 2016
cd26cc5
~ revert threading back to GSC version. Open X-Ray 'thread sync' fix …
revolucas Sep 7, 2016
2acb4e1
~ revert back to thread sync fix
revolucas Sep 8, 2016
b135760
= fix real culprit of slow loading times
revolucas Sep 8, 2016
de1bcf2
* artefact bonuses are now multiplied by it's condition
revolucas Sep 8, 2016
70ee978
= fix donate item only working for quest items, should be the reverse
revolucas Sep 10, 2016
ea1e477
~ verify member is online before switching offline
revolucas Sep 10, 2016
76c7047
= Prevent recursive failure in xrDebug::backend.
revolucas Sep 12, 2016
4f312ea
+ added bool CScriptGameObject::WeaponInGrenadeMode
revolucas Sep 14, 2016
4e716ab
= Fix crash when actor dies while entered to Vehicle or Mounted Weapon
revolucas Sep 17, 2016
01c2480
= fix phantom
revolucas Sep 29, 2016
1bc7d26
= some fixes to phantom
revolucas Oct 1, 2016
a74242d
~ revert OXR thread sync fix due to Pure Virtual Function call crashe…
revolucas Oct 28, 2016
f72f399
********
revolucas Dec 6, 2016
ef36ce7
= Fix Use Suddeness combat action (would activate even if npc had no …
revolucas Dec 8, 2016
25ab6e8
- remove debug line by avo
revolucas Dec 11, 2016
fe83023
SetSelectedItem export for CUIListBox
revolucas Dec 15, 2016
a528a6f
car exports
revolucas Dec 19, 2016
1511584
~ trying to get debug to compile. Still cannot: Loki errors 'Loki is …
revolucas Dec 19, 2016
7e63b74
~ adjusted some project properties
revolucas Dec 24, 2016
d41cabd
Merge branch 'revolucas/CoC-Xray' into feature/call_of_chernobyl
Xottab-DUTY Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/xrCore/NET_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ void NET_Packet::w_seek(u32 pos, const void* p, u32 count)
void NET_Packet::r_seek(u32 pos)
{
INI_ASSERT(r_seek)
VERIFY(pos < B.count);
//AVO: changed changed condition to <= as all net packet script utils are using r_seek(0) to read the entire packet.
VERIFY(pos <= B.count);
//VERIFY(pos < B.count);
r_pos = pos;
}

Expand Down
10 changes: 6 additions & 4 deletions src/xrEngine/xrTheora_Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,14 @@ bool CTheoraStream::Decode(u32 in_tm_play)
if (d_frame < k_frame)
{
//. dbg_log ((stderr,"%04d: preroll\n",d_frame));
VERIFY((0 != d_frame % key_rate) ||
(0 == d_frame % key_rate) && theora_packet_iskeyframe(&o_packet));
//AVO: commented out VERIFY to get COC start in Debug - something is wrong with video stream
//VERIFY((0 != d_frame % key_rate) ||
// (0 == d_frame % key_rate) && theora_packet_iskeyframe(&o_packet));
continue;
}
[[maybe_unused]] bool is_key = theora_packet_iskeyframe(&o_packet);
VERIFY((d_frame != k_frame) || ((d_frame == k_frame) && is_key));
//AVO: commented out VERIFY to get COC start in Debug - something is wrong with video stream
//[[maybe_unused]] bool is_key = theora_packet_iskeyframe(&o_packet);
//VERIFY((d_frame != k_frame) || ((d_frame == k_frame) && is_key));
// real decode
//. dbg_log ((stderr,"%04d: decode\n",d_frame));
[[maybe_unused]] int res = theora_decode_packetin(&t_state, &o_packet);
Expand Down
72 changes: 50 additions & 22 deletions src/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@

#include "xrEngine/Rain.h"

//Alundaio
#include "script_hit.h"
//-Alundaio

//const u32 patch_frames = 50;
//const float respawn_delay = 1.f;
//const float respawn_auto = 7.f;
Expand All @@ -100,7 +104,8 @@ Flags32 psActorFlags =
AF_AUTOPICKUP |
AF_RUN_BACKWARD |
AF_IMPORTANT_SAVE |
AF_MULTI_ITEM_PICKUP
AF_MULTI_ITEM_PICKUP |
AF_USE_TRACERS
};
int psActorSleepTime = 1;

Expand Down Expand Up @@ -653,13 +658,35 @@ void CActor::Hit(SHit* pHDS)
{
HDS.power = 0.0f;
inherited::Hit(&HDS);
return;
}

float hit_power = HitArtefactsOnBelt(HDS.damage(), HDS.hit_type);
HDS.power = hit_power;
HDS.power = HitArtefactsOnBelt(HDS.damage(), HDS.hit_type);
HDS.add_wound = true;
if (g_Alive())
{
CScriptHit tLuaHit;

tLuaHit.m_fPower = HDS.power;
tLuaHit.m_fImpulse = HDS.impulse;
tLuaHit.m_tDirection = HDS.direction();
tLuaHit.m_tHitType = HDS.hit_type;
tLuaHit.m_tpDraftsman = smart_cast<const CGameObject*>(HDS.who)->lua_game_object();

luabind::functor<bool> funct;
if (GEnv.ScriptEngine->functor("_G.CActor__BeforeHitCallback", funct))
{
if (!funct(smart_cast<CGameObject*>(this->lua_game_object()), &tLuaHit, HDS.boneID))
return;
}

HDS.power = tLuaHit.m_fPower;
HDS.impulse = tLuaHit.m_fImpulse;
HDS.dir = tLuaHit.m_tDirection;
HDS.hit_type = (ALife::EHitType)(tLuaHit.m_tHitType);
//HDS.who = smart_cast<CObject*>(tLuaHit.m_tpDraftsman->object());
//HDS.whoID = tLuaHit.m_tpDraftsman->ID();

/* AVO: send script callback*/
callback(GameObject::eHit)(
this->lua_game_object(),
Expand Down Expand Up @@ -780,13 +807,13 @@ void CActor::HitMark(float P, Fvector dir, IGameObject* who_object, s16 element,

void CActor::HitSignal(float perc, Fvector& vLocalDir, IGameObject* who, s16 element)
{
//AVO: get bone names from IDs
//cpcstr bone_name = smart_cast<IKinematics*>(this->Visual())->LL_BoneName_dbg(element);
//Msg("Bone [%d]->[%s]", element, bone_name);
//-AVO

if (g_Alive())
{
/* AVO: to get bone names from IDs*/
/*Log("hit info");
Log("bone ID = %s", element);
Log("bone Name = %s", smart_cast<IKinematics*>(this->Visual())->LL_BoneName_dbg(element));
Log("hit info END");*/
// check damage bone
Fvector D;
XFORM().transform_dir(D, vLocalDir);
Expand Down Expand Up @@ -1541,7 +1568,7 @@ void CActor::shedule_Update(u32 DT)
}
else if (m_pVehicleWeLookingAt)
{
m_sDefaultObjAction = m_sCarCharacterUseAction;
m_sDefaultObjAction = m_pVehicleWeLookingAt->m_sUseAction != nullptr ? m_pVehicleWeLookingAt->m_sUseAction : m_sCarCharacterUseAction;
}
else if (m_pObjectWeLookingAt && m_pObjectWeLookingAt->cast_inventory_item() &&
m_pObjectWeLookingAt->cast_inventory_item()->CanTake())
Expand Down Expand Up @@ -1928,18 +1955,19 @@ void CActor::UpdateArtefactsOnBeltAndOutfit()
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
{
conditions().ChangeBleeding(artefact->m_fBleedingRestoreSpeed * f_update_time);
conditions().ChangeHealth(artefact->m_fHealthRestoreSpeed * f_update_time);
conditions().ChangePower(artefact->m_fPowerRestoreSpeed * f_update_time);
conditions().ChangeSatiety(artefact->m_fSatietyRestoreSpeed * f_update_time);
if (artefact->m_fRadiationRestoreSpeed > 0.0f)
const float art_cond = artefact->GetCondition();
conditions().ChangeBleeding((artefact->m_fBleedingRestoreSpeed * art_cond) * f_update_time);
conditions().ChangeHealth((artefact->m_fHealthRestoreSpeed * art_cond) * f_update_time);
conditions().ChangePower((artefact->m_fPowerRestoreSpeed * art_cond) * f_update_time);
conditions().ChangeSatiety((artefact->m_fSatietyRestoreSpeed * art_cond) * f_update_time);
if (artefact->m_fRadiationRestoreSpeed * art_cond > 0.0f)
{
float val = artefact->m_fRadiationRestoreSpeed - conditions().GetBoostRadiationImmunity();
float val = (artefact->m_fRadiationRestoreSpeed * art_cond) - conditions().GetBoostRadiationImmunity();
clamp(val, 0.0f, val);
conditions().ChangeRadiation(val * f_update_time);
}
else
conditions().ChangeRadiation(artefact->m_fRadiationRestoreSpeed * f_update_time);
conditions().ChangeRadiation((artefact->m_fRadiationRestoreSpeed * art_cond) * f_update_time);
}
}

Expand Down Expand Up @@ -1986,7 +2014,7 @@ float CActor::GetProtection_ArtefactsOnBelt(ALife::EHitType hit_type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
sum += artefact->m_ArtefactHitImmunities.AffectHit(1.0f, hit_type);
sum += artefact->m_ArtefactHitImmunities.AffectHit(1.0f, hit_type) * artefact->GetCondition();
}
return sum;
}
Expand Down Expand Up @@ -2141,7 +2169,7 @@ float CActor::GetRestoreSpeed(ALife::EConditionRestoreType const& type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
res += artefact->m_fHealthRestoreSpeed;
res += artefact->m_fHealthRestoreSpeed * artefact->GetCondition();
}

const auto outfit = GetOutfit();
Expand All @@ -2156,7 +2184,7 @@ float CActor::GetRestoreSpeed(ALife::EConditionRestoreType const& type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
res += artefact->m_fRadiationRestoreSpeed;
res += artefact->m_fRadiationRestoreSpeed * artefact->GetCondition();
}

const auto outfit = GetOutfit();
Expand All @@ -2173,7 +2201,7 @@ float CActor::GetRestoreSpeed(ALife::EConditionRestoreType const& type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
res += artefact->m_fSatietyRestoreSpeed;
res += artefact->m_fSatietyRestoreSpeed * artefact->GetCondition();
}

const auto outfit = GetOutfit();
Expand All @@ -2190,7 +2218,7 @@ float CActor::GetRestoreSpeed(ALife::EConditionRestoreType const& type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
res += artefact->m_fPowerRestoreSpeed;
res += artefact->m_fPowerRestoreSpeed * artefact->GetCondition();
}
auto outfit = GetOutfit();
if (outfit)
Expand All @@ -2212,7 +2240,7 @@ float CActor::GetRestoreSpeed(ALife::EConditionRestoreType const& type)
{
const auto artefact = smart_cast<CArtefact*>(it);
if (artefact)
res += artefact->m_fBleedingRestoreSpeed;
res += artefact->m_fBleedingRestoreSpeed * artefact->GetCondition();
}

const auto outfit = GetOutfit();
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class CActor : public CEntityAlive,
void detach_Vehicle();
void steer_Vehicle(float angle);
void attach_Vehicle(CHolderCustom* vehicle);
bool use_MountedWeapon(CHolderCustom* object);
bool use_HolderEx(CHolderCustom* object, bool bForce);
virtual bool can_attach(const CInventoryItem* inventory_item) const;

protected:
Expand Down
8 changes: 4 additions & 4 deletions src/xrGame/ActorInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ bool CActor::use_Holder(CHolderCustom* holder)

if (smart_cast<CCar*>(holderGO))
b = use_Vehicle(0);
else if (holderGO->CLS_ID == CLSID_OBJECT_W_STATMGUN)
b = use_MountedWeapon(0);
else if (holderGO->CLS_ID == CLSID_OBJECT_W_STATMGUN || holderGO->CLS_ID==CLSID_OBJECT_HOLDER_ENT)
b = use_HolderEx(0, false);

if (inventory().ActiveItem())
{
Expand All @@ -596,8 +596,8 @@ bool CActor::use_Holder(CHolderCustom* holder)
if (smart_cast<CCar*>(holder))
b = use_Vehicle(holder);

if (holderGO->CLS_ID == CLSID_OBJECT_W_STATMGUN)
b = use_MountedWeapon(holder);
if (holderGO->CLS_ID == CLSID_OBJECT_W_STATMGUN || holderGO->CLS_ID==CLSID_OBJECT_HOLDER_ENT)
b = use_HolderEx(holder, false);

if (b)
{ // used succesfully
Expand Down
71 changes: 48 additions & 23 deletions src/xrGame/ActorMountedWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,61 @@
#include "xrEngine/CameraBase.h"
#include "ActorEffector.h"
#include "CharacterPhysicsSupport.h"
#include "holder_custom.h"
#include "Car.h"

bool CActor::use_MountedWeapon(CHolderCustom* object)
bool CActor::use_HolderEx(CHolderCustom* object, bool bForce)
{
/*
CHolderCustom* wpn =object;
if(m_holder){
if(!wpn||(m_holder==wpn)){
if (m_holder)
{
if (smart_cast<CCar*>(m_holder))
{
detach_Vehicle();
return true;
}
if (!m_holder->ExitLocked())
{
if (!object || (m_holder == object))
{
m_holder->detach_Actor();

if (const CGameObject* go = smart_cast<CGameObject*>(m_holder))
callback(GameObject::eDetachVehicle)(go->lua_game_object());

character_physics_support()->movement()->CreateCharacter();
m_holder=NULL;
m_holder = nullptr;
}
return true;
}else{
if(wpn){
Fvector center; Center(center);
if(wpn->Use(Device.vCameraPosition, Device.vCameraDirection,center)){
if(wpn->attach_Actor(this)){
// destroy actor character
character_physics_support()->movement()->DestroyCharacter();
PickupModeOff();
m_holder=wpn;
if (pCamBobbing){
Cameras().RemoveCamEffector(eCEBobbing);
pCamBobbing = NULL;
}
return true;
}
}
return true;
}
if (smart_cast<CCar*>(m_holder))
{
attach_Vehicle(object);
return true;
}
if (object && !object->EnterLocked())
{
Fvector center;
Center(center);
if (object->Use(Device.vCameraPosition, Device.vCameraDirection, center))
{
if (object->attach_Actor(this))
{
// destroy actor character
character_physics_support()->movement()->DestroyCharacter();

m_holder = object;
if (pCamBobbing)
{
Cameras().RemoveCamEffector(eCEBobbing);
pCamBobbing = nullptr;
}

if (const CGameObject* go = smart_cast<CGameObject*>(m_holder))
callback(GameObject::eAttachVehicle)(go->lua_game_object());
return true;
}
}
*/
}
return false;
}
5 changes: 4 additions & 1 deletion src/xrGame/ActorVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ void CActor::attach_Vehicle(CHolderCustom* vehicle)
if(!vehicle || m_holder)
return;

CCar* car = smart_cast<CCar*>(vehicle);
if (!car)
return;

//PickupModeOff();
m_holder=vehicle;

Expand All @@ -44,7 +48,6 @@ void CActor::attach_Vehicle(CHolderCustom* vehicle)
}

// temp play animation
CCar* car = smart_cast<CCar*>(m_holder);
u16 anim_type = car->DriverAnimationType();
SVehicleAnimCollection& anims = m_vehicle_anims->m_vehicles_type_collections[anim_type];
V->PlayCycle(anims.idles[0], false);
Expand Down
1 change: 1 addition & 0 deletions src/xrGame/Actor_Flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum
AF_MULTI_ITEM_PICKUP = (1 << 11),
AF_LOADING_STAGES = (1 << 12),
AF_ALWAYS_USE_ATTITUDE_SENSORS = (1 << 13), // or only when zooming if false
AF_USE_TRACERS = (1 << 14)
};

extern Flags32 psActorFlags;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Actor_Movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ float CActor::get_additional_weight() const
{
CArtefact* artefact = smart_cast<CArtefact*>(*it);
if (artefact)
res += artefact->AdditionalInventoryWeight();
res += artefact->AdditionalInventoryWeight() * artefact->GetCondition();
}

return res;
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/AmebaZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "CharacterPhysicsSupport.h"
#include "entity_alive.h"


CAmebaZone::CAmebaZone() : m_fVelocityLimit(1.f) {}

CAmebaZone::~CAmebaZone() {}
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Artefact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool CArtefact::net_Spawn(CSE_Abstract* DC)
StartLights();
m_CarringBoneID = u16(-1);
IKinematicsAnimated* K = smart_cast<IKinematicsAnimated*>(Visual());
if (K)
if (K && K->ID_Cycle_Safe("idle"))
K->PlayCycle("idle");

o_fastmode = FALSE; // start initially with fast-mode enabled
Expand Down
6 changes: 4 additions & 2 deletions src/xrGame/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ target_sources(xrGame PRIVATE
hit_memory_manager.cpp
hit_memory_manager.h
hit_memory_manager_inline.h
HolderEntityObject.cpp
HolderEntityObject.h
holder_custom.cpp
holder_custom.h
holder_custom_script.cpp
Expand Down Expand Up @@ -1508,8 +1510,6 @@ target_sources(xrGame PRIVATE
weaponBM16.cpp
weaponBM16.h
Weapon.cpp
WeaponCustomPistolAuto.cpp
WeaponCustomPistolAuto.h
WeaponCustomPistol.cpp
WeaponCustomPistol.h
WeaponDispersion.cpp
Expand Down Expand Up @@ -2315,6 +2315,8 @@ target_sources(xrGame PRIVATE
ui/UIRankFaction.h
ui/UIRankIndicator.cpp
ui/UIRankIndicator.h
ui/UIRankingsCoC.cpp
ui/UIRankingsCoC.h
ui/UIRankingWnd.cpp
ui/UIRankingWnd.h
ui/UIScriptWnd.cpp
Expand Down
Loading
Loading