CMM-22 / a3

0 stars 0 forks source link

wrong behaviour of setParticleNumber(int n) #19

Open sinoyou opened 2 years ago

sinoyou commented 2 years ago

Hello, in the provided boids.h file, the modification method setParticleNumber(int n) seems to fail change the class member variable n, because there exists a local variable named n in arguments. To fix this, we need following code: void setParticleNumber(int n) { this->n = n; }

liyuesolo commented 2 years ago

ah sorry, might be a typo for pushing this code. or something like void setParticleNumber(int _n) {n = _n;}