i need help

i have been writing a dungeon crawler type game and have encountered a problem,
in the code below this i use an if statement stating that if the user is to type library Library The library or the library it is to continue but anything else to skip the following code.However it seems that no matter what i type in it always progresses on to the next code when in fact i want it to skip on, any help would be much appreciated thanks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

string name;
string gender;
bool gotgoal = true;
string goal;
string travel;
int q1;
int q2;
int q3;
int q4;

while(gotgoal){
cout << "you find yourself standing in the middle of a village\n Where do you wish to travel?\nthe library\nthe general store\nthe postoffice\nthe music store\nthe church\nthe restaurant \n";
getline(cin, travel);

if(travel == "library"||"The library"||"Library"||"the library"){//library
cout<<"you walk into the library and are immediatly greeted by the librarian\n1)do you have any books on "<< goal << "?" <<"\n"<<"2)do you know where i can find "<< goal <<"?\n";
cin>> q1;//first library question
if( q1 == 1 ){//do you have any books on...

	cout<<"Not at the moment sorry, I can order one in if you want?\n1)sure\n2)no thanks\n";
	cin>> q2;
		if(q2 == 1){//order book
		cout<<"No problem I'll contact you when it arrives\n";
		sleep(1000);
		cout<<"book ordered!\n";
		sleep(500);
		}
		else if(q2 == 2){//dont order book
		cout<<"ok nevermind\n";
		}
}

else if( q1 == 2 ){
	cout<<"err I think i heard the general store owner talking about that the other day why dont you talk to him\n";
	
}
travel = "defualt";
}//library end
else if(travel == "store"){
	cout<<"you walk into the store\n1)Ask for manager\n2)look for "<< goal << " on shelf";

}

else if(travel == "life"){
cout<<"you walk into the store\n1)Ask for manager\n2)look for "<< goal << " on shelf";

}

}//while end 
if(travel == "library"||"The library"||"Library"||"the library"){//library
Should be replaced by:
if (travel == "library" || travel == "The library" || travel == "Library" //and so on
Last edited on
Thank you quickest reply yet seems to work great
Topic archived. No new replies allowed.