1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
Commit Graph

987 Commits

Author SHA1 Message Date
Evil Eye
231da19aa4 Load repeat flag and use reset argument 2021-11-20 11:02:58 +01:00
Evil Eye
c5de69f9c6 Merge branch 'faceyourfears' into 'master'
Make AiExtensions less toxic (bug #6429)

Closes #6429

See merge request OpenMW/openmw!1411
2021-11-20 09:59:49 +00:00
Alexei Dobrohotov
fcef92e3ea Make AiExtensions less toxic (bug #6429) 2021-11-20 03:15:15 +03:00
Evil Eye
42020bc2c3 Ignore the axis argument when rotating the player 2021-11-20 00:02:48 +00:00
Alexei Dobrohotov
7a0c13fcf8 Make better use of std::clamp 2021-11-06 08:47:32 +03:00
fredzio
68f4c336ce Rework again SetPos command to make more mods work.
Previous version skipped collision the frame immediately after a call to SetPos. It worked for one-off calls (teleports for instance) and continuous call along a pre-defined path (scenic travel). However, in the case of mod which uses SetPos to simulate a player-controlled movement, it is equivalent to using tcl.
Solution:
1/ skip update of mPosition and  mPreviousPosition to avoid janky interpolation
2/ use back plain moveObject() instead of moveObjectBy() since we don't want physics simulation
3/ rework a little bit waterwalking influence on coordinate because of 1/
2021-10-29 23:20:17 +02:00
Evil Eye
9b565c4cf9 Remove dead code 2021-10-28 22:16:43 +02:00
Bo Svensson
ef906cbfa8
improves MWClass mapping (#3166)
Currently, we use a peculiar mapping of ESM classes by their std::type_info::name. This mapping is an undefined behaviour because std::type_info::name is strictly implementation defined. It could return a non-unique value on some platforms. With this PR we use the unsigned int sRecordId of the ESM class as a more efficient lookup type that does not build on undefined behaviour. We can expect marginally faster save-game loading with these changes as well.
2021-10-11 13:46:21 +02:00
Evil Eye
dc1fe62dde Overhaul magic effects to work with onApply and onEnd events 2021-09-29 19:25:10 +02:00
Evil Eye
34cf66139a Make GetCurrentAIPackage return -1 for non-actors and dead actors 2021-09-26 22:15:43 +02:00
Evil Eye
6d7cb38834 Remove duplicate GetSquareRoot implementation 2021-09-19 19:53:38 +02:00
elsid
e84a177a91
Always print object refnum
Also print content file index even when it's negative. To be able to identify
the object unambiguously.
2021-08-12 02:02:25 +02:00
Evil Eye
29921bf9fa Don't stack cast packages 2021-08-07 10:06:56 +02:00
fredzio
a7b190ad29 Change rotateObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
2021-07-30 23:24:53 +02:00
fredzio
88a5ca440b Change moveObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
2021-07-30 23:24:49 +02:00
Evil Eye
087e933326 Close windows using Ptrs that are about to be deleted 2021-07-15 22:31:26 +02:00
Petr Mikheev
d5cda61855 Console command "reload lua" 2021-07-09 20:24:56 +02:00
psi29a
d8bed73ada Merge branch 'local_crache' into 'master'
Cache failed compilation when getting locals

Closes #6123

See merge request OpenMW/openmw!988
2021-07-08 22:16:15 +00:00
Evil Eye
eced6f2126 Implement the help command 2021-07-07 18:48:25 +02:00
Evil Eye
18f297a4e0 Allow a missing implicit argument for GetDistance 2021-07-05 18:34:09 +02:00
Evil Eye
0a15d7740a Delay physics for objects created by scripts 2021-07-05 18:34:06 +02:00
Evil Eye
9a7c07173d Cache failed compilation when getting locals 2021-07-04 10:58:12 +02:00
Dobrohotov Alexei
3cab69c389 Fix ShowMap partial match filtering (bug #6115) 2021-07-03 01:04:22 +03:00
Evil Eye
2be27da791 Merge branch 'const_refs' into 'master'
Add a ton of const refs

See merge request OpenMW/openmw!954
2021-06-24 18:57:41 +00:00
jvoisin
b2c170efa0 Use initialization lists where possible 2021-06-23 23:36:43 +02:00
jvoisin
1123dc46ee Add a ton of const refs 2021-06-23 23:13:59 +02:00
Evil Eye
690e5ef757 Don't resolve a script's target just to get the ID 2021-06-19 19:26:57 +02:00
Evil Eye
67c8d73fe0 Allow scripts to fail per target 2021-06-19 19:26:55 +02:00
Evil Eye
879e66a043 Don't autoequip items when implicitely adding an item using equip 2021-06-19 19:26:53 +02:00
Evil Eye
382d458f9c Ignore wrong reference class for SetHello 2021-06-19 19:26:53 +02:00
psi29a
9b017ef04d Merge branch 'internal_includes_openmw' into 'master'
Clean up some internal includes of the openmw component

See merge request OpenMW/openmw!796
2021-05-07 10:53:25 +00:00
psi29a
9eb876cc17 Merge branch 'read_me' into 'master'
Allow activation of inventory items

Closes #5991

See merge request OpenMW/openmw!788
2021-05-04 22:53:45 +00:00
fredzio
4fa0972b2d Tone down actor's skip simulation flag to an optional skip collision
detection flag.
2021-05-01 14:22:30 +02:00
Evil Eye
bd45449f9d Allow activation of inventory items 2021-05-01 14:07:29 +02:00
jvoisin
998cc97a4f And done! 2021-04-30 20:49:22 +02:00
fredzio
fda639eb57 Remove unused forward declarations 2021-04-11 14:46:51 +02:00
fredzio
8874a5be22 Change (again) the way SetPos behave.
Instead of registering the desired change of position and rely on
physics simulation to apply it to the world, immediately change the
position in the world without reset the simulation.
2021-04-09 23:34:03 +02:00
Evil Eye
44f2cb0923 Fix targeted scripts losing their targets when rearranging your load order 2021-04-07 17:30:21 +02:00
Evil Eye
ecde3932e2 Make AddItem's quantity overflow on negative numbers 2021-04-05 09:43:37 +02:00
fredzio
9cae7882dd Fix a bug that was triggered with multi mark mod.
When a script calls SetPos for x,y,z in sequence on an actor, we need to make sure
that the actor will not spawn under ground at x,y coordinates.
Now that change of coordinates are cumulated and applied all at once, we
need to account for the whole offset.
To this end move the terrain height check inside of Actor class.
2021-03-31 19:34:06 +02:00
Petr Mikheev
7bbbe40abe "static const" -> "static constexpr" in headers 2021-03-21 13:57:54 +01:00
fredzio
cb39f8fb01 Use moveObjectBy in SetPos 2021-03-13 09:53:21 +01:00
Evil Eye
f1caeea444 Don't return negative values from GetMagicka 2021-02-07 11:58:23 +01:00
Evil Eye
61e014a765 Allow negative values for ai stats 2021-02-04 21:25:38 +01:00
unknown
3bf641d3ce Show mesh origin 2020-12-29 21:45:59 +01:00
fredzio
7bae6691b6 Introduce World::moveObjectBy() function to translate an object relatively to
its current position.
Use it in relevant MWScripts opcode (move and moveworld).
Remove the fragile detection of scripted translation from PhysicsTaskScheduler.

No user visible change, just a more robust mechanism.
2020-12-18 08:40:38 +01:00
Andrei Kortunov
8084a336b5 Replace zeroes and nulls by nullptrs 2020-11-29 11:14:07 +04:00
fredzio
e5fa457fe7 Properly account for interleaved move of actors.
Before this change, if an actor position was changed while the physics
simulation was running, the simulation result would be discarded. It is
fine in case of one off event such as teleport, but in the case of
scripts making use of this functionality to make lifts or conveyor (such
as Sotha Sil Expanded mod) it broke actor movement.

To alleviate this issue, at the end of the simulation, the position of the Actor
in the world is compared to the position it had at the beginning of the
simulation. A difference indicate a force move occured. In this case,
the Actor mPosition and mPreviousPosition are translated by the difference of position.

Since the Actor position will be really set while the next simulation runs, we
save it in the mNextPosition field.
2020-11-14 20:39:16 +01:00
Alexei Dobrohotov
53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
2020-11-01 01:58:56 +03:00
fredzio
4876969153 Use the PhysicsSystem::movementQueue instead of a serie of
setPosition(getPosition() + diff) to move actor in scripts.
With background physics, this is very slightly off with the collision
object position.
When the script run long enough (a few dozen frames for instance),
the accumulated error becomes too big. It make actors fall through lifts floors.
2020-10-30 23:59:09 +01:00