Skip to content

Commit b3e9e69

Browse files
authored
Merge pull request #715 from tiltedphoques/dev
v1.6.8
2 parents 8de72ba + b4155e6 commit b3e9e69

File tree

73 files changed

+1059
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1059
-269
lines changed

.github/workflows/linux.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: "!contains(github.event.head_commit.message, 'ci skip')"
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222

2323
- name: Checkout submodules
2424
run: |
@@ -28,32 +28,27 @@ jobs:
2828
# Install dependencies
2929
- name: Update apt repositories
3030
run: sudo apt-get update
31-
32-
- name: Install GCC12
33-
shell: bash
34-
run: |
35-
sudo apt update
36-
sudo apt install gcc-12 g++-12
37-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
38-
31+
3932
# Install xmake
4033
- name: Setup xmake
4134
uses: xmake-io/github-action-setup-xmake@v1
4235
with:
43-
xmake-version: '2.9.2'
36+
xmake-version: '2.9.5'
4437

4538
# Update xmake repository (in order to have the file that will be cached)
4639
- name: Update xmake repository
4740
run: xmake repo --update
4841

4942
# Setup compilation mode and install project dependencies
43+
# (continue-on-error + timeout is a temporary solution until sentry-native is fixed; shouldn't affect the building step)
5044
- name: Configure xmake and install dependencies
51-
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes
45+
continue-on-error: true
46+
run: timeout 15m xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes
5247

53-
# Build the game
48+
# Build the server
5449
- name: Build
55-
run: xmake
56-
50+
run: xmake -y
51+
5752
# Create install
5853
#- name: Install
5954
# run: xmake install -o packaged

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Setup xmake
3131
uses: xmake-io/github-action-setup-xmake@v1
3232
with:
33-
xmake-version: '2.9.2'
33+
xmake-version: '2.9.5'
3434

3535
# Install node
3636
#- name: Setup nodejs

Code/client/Events/ActivateEvent.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ struct ActivateEvent
2222
{
2323
}
2424
#elif TP_SKYRIM64
25-
ActivateEvent(TESObjectREFR* apObject, Actor* apActivator, TESBoundObject* apObjectToGet, int32_t aCount, bool aDefaultProcessing, uint8_t aUnk1, bool aActivateFlag = false)
25+
ActivateEvent(TESObjectREFR* apObject, Actor* apActivator, TESBoundObject* apObjectToGet, int32_t aCount, bool aDefaultProcessing, uint8_t aUnk1, TESObjectREFR::OpenState aPreActivationOpenState, bool aActivateFlag = false)
2626
: pObject(apObject)
2727
, pActivator(apActivator)
2828
, pObjectToGet(apObjectToGet)
2929
, Count(aCount)
3030
, DefaultProcessing(aDefaultProcessing)
3131
, Unk1(aUnk1)
32+
, PreActivationOpenState(aPreActivationOpenState)
3233
, ActivateFlag(aActivateFlag)
3334
{
3435
}
@@ -46,5 +47,6 @@ struct ActivateEvent
4647
uint8_t Unk1;
4748
#endif
4849

50+
TESObjectREFR::OpenState PreActivationOpenState;
4951
bool ActivateFlag;
5052
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
3+
struct SetTimeCommandEvent
4+
{
5+
SetTimeCommandEvent() = delete;
6+
SetTimeCommandEvent(uint8_t aHours, uint8_t aMinutes, uint32_t aPlayerId)
7+
: Hours(aHours)
8+
, Minutes(aMinutes)
9+
, PlayerId(aPlayerId)
10+
{
11+
}
12+
13+
uint8_t Hours;
14+
uint8_t Minutes;
15+
uint32_t PlayerId;
16+
};

Code/client/Games/Fallout4/TESObjectREFR.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ struct TESObjectREFR : TESForm
3131
IRR_STORE_IN_TEAMMATE = 0x5,
3232
};
3333

34+
enum OpenState : uint8_t
35+
{
36+
kNone = 0,
37+
kOpen,
38+
kOpening,
39+
kClosed,
40+
kClosing,
41+
};
42+
3443
struct RemoveItemData
3544
{
3645
uint8_t stackData[0x20]{};
@@ -194,6 +203,7 @@ struct TESObjectREFR : TESForm
194203
void LockChange() noexcept;
195204

196205
const float GetHeight() noexcept;
206+
OpenState GetOpenState() noexcept;
197207

198208
Inventory GetInventory() const noexcept;
199209
void SetInventory(const Inventory& acContainer) noexcept;

Code/client/Games/References.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ const float TESObjectREFR::GetHeight() noexcept
690690
return boundMax.z - GetBoundMin().z;
691691
}
692692

693+
TESObjectREFR::OpenState TESObjectREFR::GetOpenState() noexcept
694+
{
695+
using ObjectReference = TESObjectREFR;
696+
697+
PAPYRUS_FUNCTION(TESObjectREFR::OpenState, ObjectReference, GetOpenState);
698+
699+
return s_pGetOpenState(this);
700+
}
701+
693702
bool ActorState::SetWeaponDrawn(bool aDraw) noexcept
694703
{
695704
TP_THIS_FUNCTION(TSetWeaponState, bool, ActorState, bool aDraw);

Code/client/Games/Skyrim/Forms/MagicItem.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ bool MagicItem::IsBuffSpell() const noexcept
3131
}
3232
}
3333

34+
bool MagicItem::IsBoundWeaponSpell() noexcept
35+
{
36+
for (EffectItem* pEffect : listOfEffects)
37+
{
38+
if (pEffect->pEffectSetting && pEffect->pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kBoundWeapon)
39+
return true;
40+
}
41+
42+
return false;
43+
}
44+
3445
EffectItem* MagicItem::GetEffect(const uint32_t aEffectId) noexcept
3546
{
3647
for (EffectItem* pEffect : listOfEffects)

Code/client/Games/Skyrim/Forms/MagicItem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct MagicItem : TESBoundObject
1313
bool IsInvisibilitySpell() const noexcept;
1414
bool IsHealingSpell() const noexcept;
1515
bool IsBuffSpell() const noexcept;
16+
bool IsBoundWeaponSpell() noexcept;
1617

1718
EffectItem* GetEffect(const uint32_t aEffectId) noexcept;
1819

Code/client/Games/Skyrim/TESObjectREFR.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,15 @@ bool TP_MAKE_THISCALL(HookActivate, TESObjectREFR, TESObjectREFR* apActivator, u
611611
// Exclude books from activation since only reading them removes them from the cell
612612
// Note: Books are now unsynced
613613
if (pActivator && apThis->baseForm->formType != FormType::Book)
614-
World::Get().GetRunner().Trigger(ActivateEvent(apThis, pActivator, apObjectToGet, aUnk1, aCount, aDefaultProcessing));
614+
{
615+
auto openState = TESObjectREFR::kNone;
616+
if (apThis->baseForm->formType == FormType::Door)
617+
openState = apThis->GetOpenState();
618+
619+
World::Get().GetRunner().Trigger(
620+
ActivateEvent(apThis, pActivator, apObjectToGet, aCount, aDefaultProcessing, aUnk1, openState)
621+
);
622+
}
615623

616624
return TiltedPhoques::ThisCall(RealActivate, apThis, apActivator, aUnk1, apObjectToGet, aCount, aDefaultProcessing);
617625
}

Code/client/Games/Skyrim/TESObjectREFR.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ struct TESObjectREFR : TESForm
4747
CHANGE_REFR_EXTRA_GAME_ONLY = 1u << 31,
4848
};
4949

50+
enum OpenState : uint8_t
51+
{
52+
kNone = 0,
53+
kOpen,
54+
kOpening,
55+
kClosed,
56+
kClosing,
57+
};
58+
5059
static TESObjectREFR* GetByHandle(uint32_t aHandle) noexcept;
5160
static uint32_t* GetNullHandle() noexcept;
5261

@@ -188,6 +197,7 @@ struct TESObjectREFR : TESForm
188197

189198
const float GetHeight() noexcept;
190199
void EnableImpl() noexcept;
200+
OpenState GetOpenState() noexcept;
191201

192202
Inventory GetInventory() const noexcept;
193203
Inventory GetInventory(std::function<bool(TESForm&)> aFilter) const noexcept;

0 commit comments

Comments
 (0)