mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
De-duplicate say/reply line adding code
I found it patently ridiculous that `i++; add(customscript[i]);` was copy-pasted four separate times. Well, at least it's only copy-pasted twice now.
This commit is contained in:
@@ -3792,11 +3792,8 @@ void scriptclass::loadcustom(std::string t)
|
||||
break;
|
||||
}
|
||||
int ti=atoi(words[1].c_str());
|
||||
if(ti>=0 && ti<=50){
|
||||
for(int ti2=0; ti2<ti; ti2++){
|
||||
i++; add(customscript[i]);
|
||||
}
|
||||
}else{
|
||||
int nti = ti>=0 && ti<=50 ? ti : 1;
|
||||
for(int ti2=0; ti2<nti; ti2++){
|
||||
i++; add(customscript[i]);
|
||||
}
|
||||
|
||||
@@ -3817,11 +3814,8 @@ void scriptclass::loadcustom(std::string t)
|
||||
add("text(cyan,0,0,"+words[1]+")");
|
||||
|
||||
int ti=atoi(words[1].c_str());
|
||||
if(ti>=0 && ti<=50){
|
||||
for(int ti2=0; ti2<ti; ti2++){
|
||||
i++; add(customscript[i]);
|
||||
}
|
||||
}else{
|
||||
int nti = ti>=0 && ti<=50 ? ti : 1;
|
||||
for(int ti2=0; ti2<nti; ti2++){
|
||||
i++; add(customscript[i]);
|
||||
}
|
||||
add("position(player,above)");
|
||||
|
||||
Reference in New Issue
Block a user