Use Contains method where applicable

This commit is contained in:
Lwmte 2025-04-04 09:08:55 +02:00
parent d2d6645fe8
commit ab55a7cf14
5 changed files with 11 additions and 8 deletions

View file

@ -172,7 +172,7 @@
(e.g.</td>
</tr>
<tr>
<td class="name" ><a href="#Moveable:GetJointPosition">Moveable:GetJointPosition(jointID[, offset])</a></td>
<td class="name" ><a href="#Moveable:GetJointPosition">Moveable:GetJointPosition(jointIndex[, offset])</a></td>
<td class="summary">Get the moveable's joint position with an optional relative offset.</td>
</tr>
<tr>
@ -771,7 +771,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
</dd>
<dt>
<a name = "Moveable:GetJointPosition"></a>
<strong>Moveable:GetJointPosition(jointID[, offset])</strong>
<strong>Moveable:GetJointPosition(jointIndex[, offset])</strong>
</dt>
<dd>
Get the moveable's joint position with an optional relative offset.
@ -780,9 +780,9 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">jointID</span>
<li><span class="parameter">jointIndex</span>
<span class="types"><span class="type">int</span></span>
Joint ID.
Index of a joint to get position.
</li>
<li><span class="parameter">offset</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>

View file

@ -32,6 +32,7 @@
#include "Specific/clock.h"
#include "Specific/Input/Input.h"
#include "Specific/level.h"
#include "Specific/trutils.h"
using namespace TEN::Collision::Point;
using namespace TEN::Effects::Bubble;
@ -1594,7 +1595,7 @@ void HandleProjectile(ItemInfo& projectile, ItemInfo& emitter, const Vector3i& p
for (auto* itemPtr : collObjects.Items)
{
// Object was already affected by collision, skip it.
if (std::find(affectedObjects.begin(), affectedObjects.end(), itemPtr->Index) != affectedObjects.end())
if (TEN::Utils::Contains(affectedObjects, itemPtr->Index))
continue;
const auto& currentObject = Objects[itemPtr->ObjectNumber];

View file

@ -22,6 +22,7 @@
#include "Sound/sound.h"
#include "Specific/Input/Input.h"
#include "Specific/level.h"
#include "Specific/trutils.h"
#include "Specific/winmain.h"
using namespace TEN::Collision::Point;
@ -1392,7 +1393,7 @@ static std::vector<int> FillCollideableItemList()
{
const auto& item = g_Level.Items[i];
if (std::find(roomList.begin(), roomList.end(), item.RoomNumber) == roomList.end())
if (!TEN::Utils::Contains(roomList, (int)item.RoomNumber))
continue;
if (!g_Level.Rooms[item.RoomNumber].Active())

View file

@ -31,6 +31,7 @@
#include "Renderer/Structures/RendererSortableObject.h"
#include "Specific/configuration.h"
#include "Specific/level.h"
#include "Specific/trutils.h"
#include "Specific/winmain.h"
using namespace TEN::Effects::Hair;
@ -2712,7 +2713,7 @@ namespace TEN::Renderer
if (rendererPass != RendererPass::GBuffer)
{
// Bind caustics texture.
if (std::find(SpriteSequencesIds.begin(), SpriteSequencesIds.end(), ID_CAUSTIC_TEXTURES) != SpriteSequencesIds.end())
if (TEN::Utils::Contains(SpriteSequencesIds, (int)ID_CAUSTIC_TEXTURES))
{
int nmeshes = -Objects[ID_CAUSTIC_TEXTURES].nmeshes;
int meshIndex = Objects[ID_CAUSTIC_TEXTURES].meshIndex;

View file

@ -835,7 +835,7 @@ namespace TEN::Renderer
}
// Light already on a list
if (std::find(renderView.LightsToDraw.begin(), renderView.LightsToDraw.end(), light) != renderView.LightsToDraw.end())
if (TEN::Utils::Contains(renderView.LightsToDraw, light))
{
continue;
}