1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 02:15:34 +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); };