1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-26 03:16:35 +00:00

Access channels and controls via at function

To avoid UB on out of range access.
This commit is contained in:
elsid 2024-08-20 23:55:00 +02:00
parent ca2bacd47a
commit 58b72e3836
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -84,11 +84,11 @@ namespace ICS
// in seconds
void update(float timeSinceLastFrame);
inline Channel* getChannel(int i){ return mChannels[i]; };
Channel* getChannel(int i){ return mChannels.at(i); };
float getChannelValue(int i);
inline int getChannelCount(){ return (int)mChannels.size(); };
inline Control* getControl(int i){ return mControls[i]; };
Control* getControl(int i){ return mControls.at(i); };
float getControlValue(int i);
inline int getControlCount(){ return (int)mControls.size(); };
inline void addControl(Control* control){ mControls.push_back(control); };